Ticket #7359: 7359.patch

File 7359.patch, 1.4 KB (added by Garry Yao, 13 years ago)
  • _source/plugins/domiterator/plugin.js

     
    3131
    3232        var beginWhitespaceRegex = /^[\r\n\t ]+$/,
    3333                // Ignore bookmark nodes.(#3783)
    34                 bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true );
     34                bookmarkGuard = CKEDITOR.dom.walker.bookmark( false, true ),
     35                whitespacesGuard = CKEDITOR.dom.walker.whitespaces( true ),
     36                skipGuard = function( node ) { return bookmarkGuard( node ) && whitespacesGuard( node ); };
    3537
    3638        // Get a reference for the next element, bookmark nodes are skipped.
    3739        function getNextSourceNode( node, startFromSibling, lastNode )
     
    207209                                // to close the range, otherwise we include the parent within it.
    208210                                if ( range && !closeRange )
    209211                                {
    210                                         while ( !currentNode.getNext( bookmarkGuard ) && !isLast )
     212                                        while ( !currentNode.getNext( skipGuard ) && !isLast )
    211213                                        {
    212214                                                var parentNode = currentNode.getParent();
    213215
     
    215217                                                                && !parentPre && { br : 1 } ) )
    216218                                                {
    217219                                                        closeRange = 1;
     220                                                        includeNode = 0;
    218221                                                        isLast = isLast || ( parentNode.equals( lastNode) );
     222                                                        // Make sure range includes bookmarks at the end of the block. (#7359)
     223                                                        range.setEndAt( parentNode, CKEDITOR.POSITION_BEFORE_END );
    219224                                                        break;
    220225                                                }
    221226
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy