Index: _source/plugins/enterkey/plugin.js =================================================================== --- _source/plugins/enterkey/plugin.js (revision 5410) +++ _source/plugins/enterkey/plugin.js (revision ) @@ -292,9 +292,21 @@ function shiftEnter( editor ) { - // On SHIFT+ENTER we want to enforce the mode to be respected, instead + // Only effective within document. + if ( editor.mode != 'wysiwyg' ) + return false; + + // On SHIFT+ENTER: + // 1. We want to enforce the mode to be respected, instead // of cloning the current block. (#77) + // 2. Always perform a block break when inside
(#5402). + if ( editor.getSelection().getStartElement().hasAscendant( 'pre', true ) ) + { + setTimeout( function() { enterBlock( editor, editor.config.enterMode, null, true ); }, 0 ); + return true; + } + else - return enter( editor, editor.config.shiftEnterMode, true ); + return enter( editor, editor.config.shiftEnterMode, true ); } function enter( editor, mode, forceMode ) Index: _source/core/dom/element.js =================================================================== --- _source/core/dom/element.js (revision 5396) +++ _source/core/dom/element.js (revision ) @@ -1472,7 +1472,7 @@ this.moveChildren( newNode ); // Replace the node. - this.$.parentNode.replaceChild( newNode.$, this.$ ); + this.getParent() && this.$.parentNode.replaceChild( newNode.$, this.$ ); newNode.$._cke_expando = this.$._cke_expando; this.$ = newNode.$; },