Ticket #5402: 5402_2.patch

File 5402_2.patch, 1.5 KB (added by Garry Yao, 14 years ago)
  • _source/plugins/enterkey/plugin.js

     
    292292
    293293        function shiftEnter( editor )
    294294        {
    295                 // On SHIFT+ENTER we want to enforce the mode to be respected, instead
     295                // Only effective within document.
     296                if ( editor.mode != 'wysiwyg' )
     297                        return false;
     298
     299                // On SHIFT+ENTER:
     300                // 1. We want to enforce the mode to be respected, instead
    296301                // of cloning the current block. (#77)
    297                 return enter( editor, editor.config.shiftEnterMode, true );
     302                // 2. Always perform a block break when inside <pre> (#5402).
     303                if ( editor.getSelection().getStartElement().hasAscendant( 'pre', true ) )
     304                {
     305                        setTimeout( function() { enterBlock( editor, editor.config.enterMode, null, true ); }, 0 );
     306                        return true;
     307                }
     308                else
     309                        return enter( editor, editor.config.shiftEnterMode, true );
    298310        }
    299311
    300312        function enter( editor, mode, forceMode )
  • _source/core/dom/element.js

     
    14721472                        this.moveChildren( newNode );
    14731473
    14741474                        // Replace the node.
    1475                         this.$.parentNode.replaceChild( newNode.$, this.$ );
     1475                        this.getParent() && this.$.parentNode.replaceChild( newNode.$, this.$ );
    14761476                        newNode.$._cke_expando = this.$._cke_expando;
    14771477                        this.$ = newNode.$;
    14781478                },
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy