Ticket #5584: 5584.patch

File 5584.patch, 1018 bytes (added by Garry Yao, 14 years ago)
  • _source/plugins/enterkey/plugin.js

     
    100100                                        // Do not enter this block if it's a header tag, or we are in
    101101                                        // a Shift+Enter (#77). Create a new block element instead
    102102                                        // (later in the code).
    103                                         if ( previousBlock.is( 'li' ) ||
    104                                                  !( forceMode || headerTagRegex.test( previousBlock.getName() ) ) )
     103                                        if ( previousBlock.is( 'li' ) || !headerTagRegex.test( previousBlock.getName() ) )
    105104                                        {
    106105                                                // Otherwise, duplicate the previous block.
    107106                                                newBlock = previousBlock.clone();
     
    112111
    113112                                if ( !newBlock )
    114113                                        newBlock = doc.createElement( blockTag );
     114                                else if ( forceMode )
     115                                        newBlock.renameNode( blockTag );
    115116
    116117                                // Recreate the inline elements tree, which was available
    117118                                // before hitting enter, so the same styles will be available in
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy