Index: _source/plugins/wysiwygarea/plugin.js =================================================================== --- _source/plugins/wysiwygarea/plugin.js (revision 6458) +++ _source/plugins/wysiwygarea/plugin.js (revision ) @@ -811,7 +811,31 @@ } } ); } + + // Prevent IE from leaving new paragraph after deleting all contents in body. (#6966) + editor.config.enterMode != CKEDITOR.ENTER_P + && domDocument.on( 'selectionchange', function() + { + var body = domDocument.getBody(), + range = editor.getSelection().getRanges()[ 0 ]; + + if ( body.getHtml().match( /^
<\/p>$/i ) + && range.startContainer.equals( body ) ) + { + // Avoid the ambiguity from a real user cursor position. + setTimeout( function () + { + range = editor.getSelection().getRanges()[ 0 ]; + if ( !range.startContainer.equals ( 'body' ) ) + { + body.getFirst().remove( 1 ); + range.moveToElementEditEnd( body ); + range.select( 1 ); - } + } + }, 0 ); + } + }); + } // Adds the document body as a context menu target. if ( editor.contextMenu )