Ticket #3411: 3411.patch

File 3411.patch, 1.2 KB (added by Josh Nisly, 14 years ago)
  • _source/plugins/styles/plugin.js

     
    521521                if ( range.collapsed )
    522522                {
    523523                        /*
    524                          * If the range is collapsed, try to remove the style from all ancestor
    525                          * elements, until a block boundary is reached.
     524                         * If the range is collapsed, break the style parent, creating a section
     525                         * without the style.
    526526                         */
    527527                        var startPath = new CKEDITOR.dom.elementPath( startNode.getParent() );
    528528                        for ( var i = 0, element ; i < startPath.elements.length && ( element = startPath.elements[i] ) ; i++ )
     
    531531                                        break;
    532532
    533533                                if ( this.checkElementRemovable( element ) )
    534                                 {
    535                                         /*
    536                                          * Before removing the style node, there may be a sibling to the style node
    537                                          * that's exactly the same to the one to be removed. To the user, it makes
    538                                          * no difference that they're separate entities in the DOM tree. So, merge
    539                                          * them before removal.
    540                                          */
    541                                         mergeSiblings( element );
    542                                         removeFromElement( this, element );
    543                                 }
     534                                        startNode.breakParent(element);
    544535                        }
    545536                }
    546537                else
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy