Ticket #3730: 3730.patch

File 3730.patch, 2.3 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/domiterator/plugin.js

     
    1919
    2020                this.range = range;
    2121                this.forceBrBreak = false;
     22
     23                // Whether include <br>s into the enlarged range.(#3730).
     24                this.enlargeBr = true;
    2225                this.enforceRealBlocks = false;
    2326
    2427                this._ || ( this._ = {} );
     
    4548                        if ( !this._.lastNode )
    4649                        {
    4750                                range = this.range.clone();
    48                                 range.enlarge( this.forceBrBreak ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS );
     51                                range.enlarge( this.forceBrBreak || !this.enlargeBr ?
     52                                                           CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS );
    4953
    5054                                var walker = new CKEDITOR.dom.walker( range ),
    5155                                        ignoreBookmarkTextEvaluator = CKEDITOR.dom.walker.bookmark( true, true );
     
    241245                                        // If the range doesn't includes the entire contents of the
    242246                                        // block, we must split it, isolating the range in a dedicated
    243247                                        // block.
    244                                         if ( !range.checkStartOfBlock() || !range.checkEndOfBlock() )
     248                                        if ( this.enlargeBr && !( range.checkStartOfBlock() && range.checkEndOfBlock() ) )
    245249                                        {
    246250                                                // The resulting block will be a clone of the current one.
    247251                                                block = block.clone( false );
  • _source/plugins/indent/plugin.js

     
    153153
    154154        function indentBlock( editor, range )
    155155        {
    156                 var iterator = range.createIterator();
     156                var iterator = range.createIterator(),
     157                        enterMode = editor.config.enterMode;
    157158                iterator.enforceRealBlocks = true;
    158 
     159                iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR;
    159160                var block;
    160                 while ( ( block = iterator.getNextParagraph() ) )
    161                 {
    162161
     162                // Use 'div' as default grouping tag for multiple lines breaked by <br>.
     163                while ( ( block = iterator.getNextParagraph( enterMode == CKEDITOR.ENTER_BR ? 'div' : 'p' ) ) )
     164                {
    163165                        if ( this.useIndentClasses )
    164166                        {
    165167                                // Transform current class name to indent step index.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy