Ticket #4450: 4450_3.patch

File 4450_3.patch, 1.5 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/domiterator/plugin.js

     
    2525                this.enforceRealBlocks = false;
    2626
    2727                this._ || ( this._ = {} );
    28         },
    29                 beginWhitespaceRegex = /^[\r\n\t ]+$/;
     28        };
    3029
     30        var beginWhitespaceRegex = /^[\r\n\t ]+$/,
     31                isBookmark = CKEDITOR.dom.walker.bookmark();
    3132
    3233        iterator.prototype = {
    3334                getNextParagraph : function( blockTag )
     
    211212                                // loop.
    212213                                if ( ( closeRange || isLast ) && range )
    213214                                {
    214                                         var boundaryNodes = range.getBoundaryNodes(),
    215                                                 startPath = new CKEDITOR.dom.elementPath( range.startContainer ),
    216                                                 endPath = new CKEDITOR.dom.elementPath( range.endContainer );
     215                                        var boundaryNodes = range.getBoundaryNodes();
    217216
    218                                         // Drop the range if it only contains bookmark nodes.(#4087)
    219                                         if ( boundaryNodes.startNode.equals( boundaryNodes.endNode )
    220                                                 && boundaryNodes.startNode.getParent().equals( startPath.blockLimit )
    221                                                 && boundaryNodes.startNode.type == CKEDITOR.NODE_ELEMENT
    222                                                 && boundaryNodes.startNode.getAttribute( '_fck_bookmark' ) )
     217                                        // Drop the range if it only contains bookmark nodes, and is
     218                                        // not because of the original collapsed range. (#4087,#4450)
     219                                        if ( !this.range.collapsed
     220                                                 && isBookmark( boundaryNodes.startNode ) && isBookmark( boundaryNodes.endNode ) )
    223221                                        {
    224222                                                range = null;
    225223                                                this._.nextNode = null;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy