Ticket #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
Change History
Changed 3 years ago by yiminghe
- Attachment inline-style.png added
comment:1 Changed 3 years ago by yiminghe
'' indicates start selection position and '$' indicates end selection position.
comment:2 Changed 3 years ago by garry.yao
- Keywords inline style format removed
- Priority changed from Normal to Low
- Status changed from new to confirmed
- Milestone set to CKEditor 3.5.1
Yet another bookmark sucker, having no impacts on WYSYWIG, mark as low-pri, though requires a fix, thanks yiminghe.
Note: See
TracTickets for help on using
tickets.

incorrect code generated