Ticket #6687 (closed Bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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

inline-style.png (4.1 KB) - added by yiminghe 3 years ago.
incorrect code generated
6687.patch (1.6 KB) - added by garry.yao 3 years ago.

Change History

Changed 3 years ago by yiminghe

incorrect code generated

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

  • Status changed from new to confirmed
  • Keywords inline style format removed
  • Priority changed from Normal to Low
  • 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.

Changed 3 years ago by garry.yao

comment:3 Changed 3 years ago by garry.yao

  • Owner set to garry.yao
  • Status changed from confirmed to review

comment:4 Changed 3 years ago by tobiasz.cudnik

  • Status changed from review to review_passed

comment:5 Changed 3 years ago by garry.yao

  • Status changed from review_passed to closed
  • Resolution set to fixed

Fixed with [6275].

Note: See TracTickets for help on using tickets.
© 2003 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy