Ticket #4450: 4450_2.patch

File 4450_2.patch, 1.6 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
     218                                        // been an inappropriate place for paragraphing, e.g. between
     219                                        // table cells. (#4087,#4450)
     220                                        if ( isBookmark( boundaryNodes.startNode ) && isBookmark( boundaryNodes.endNode )
     221                                                 && !range.getCommonAncestor().isEditable() )
    223222                                        {
    224223                                                range = null;
    225224                                                this._.nextNode = null;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy