Opened 15 years ago
Closed 15 years ago
#6687 closed Bug (fixed)
empty tag should be removed on inline-style format
| Reported by: | yiminghe | Owned by: | Garry Yao |
|---|---|---|---|
| Priority: | Low | Milestone: | CKEditor 3.5.1 |
| Component: | Core : Styles | Version: | 3.4.2 |
| Keywords: | Cc: |
Description
example:
<span style='font-size:28px;'>^测试$</span>
indicates start selection position and $ indicates end selection position.
when apply inline-style format such as change to 48px , now the code generated is (use firebug pls)
{{{
<span style='font-size:48px;'>测试</span>
<span style='font-size:28px;'></span>
}}}
it should be : (no empty style tag)
<span style='font-size:48px;'>测试</span>
i fix it :
in 3.4.2/_source/plugins/styles/plugin.js line 449 ,add following code :
var validNextSilbing = includedNode.getNext(function(node) {
return !node.getAttribute || !node.getAttribute("_cke_bookmark");
});
while ( !validNextSilbing
&& ( parentNode = includedNode.getParent(), dtd[ parentNode.getName() ] )
&& ( parentNode.getPosition( firstNode ) | CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED ) == ( CKEDITOR.POSITION_FOLLOWING + CKEDITOR.POSITION_IDENTICAL + CKEDITOR.POSITION_IS_CONTAINED )
&& ( !def.childRule || def.childRule( parentNode ) ) )
{
includedNode = parentNode;
}
in summary ,we should ignore bookmark and include parent node in style range.
Attachments (2)
Change History (7)
Changed 15 years ago by
| Attachment: | inline-style.png added |
|---|
comment:1 Changed 15 years ago by
'' indicates start selection position and '$' indicates end selection position.
comment:2 Changed 15 years ago by
| Keywords: | inline style format removed |
|---|---|
| Milestone: | → CKEditor 3.5.1 |
| Priority: | Normal → Low |
| Status: | new → confirmed |
Yet another bookmark sucker, having no impacts on WYSYWIG, mark as low-pri, though requires a fix, thanks yiminghe.
Changed 15 years ago by
| Attachment: | 6687.patch added |
|---|
comment:3 Changed 15 years ago by
| Owner: | set to Garry Yao |
|---|---|
| Status: | confirmed → review |
comment:4 Changed 15 years ago by
| Status: | review → review_passed |
|---|
comment:5 Changed 15 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | review_passed → closed |
Fixed with [6275].

incorrect code generated