- // All browsers are incapable to moving cursor out of certain non-exitable\r
- // blocks (e.g. table, list, pre) at the end of document, make this happen by\r
- // place a bogus node there, which would be later removed by dataprocessor.\r
- var walkerRange = new CKEDITOR.dom.range( editor.document ),\r
- walker = new CKEDITOR.dom.walker( walkerRange );\r
- walkerRange.selectNodeContents( body );\r
- walker.evaluator = function( node )\r
- {\r
- return node.type == CKEDITOR.NODE_ELEMENT && ( node.getName() in nonExitableElementNames );\r
- };\r
- walker.guard = function( node, isMoveout )\r
- {\r
- return !( ( node.type == CKEDITOR.NODE_TEXT && isNotWhitespace( node ) ) || isMoveout );\r
- };\r
-\r
- if ( walker.previous() )\r
+ // Browsers are incapable of moving cursor out of certain block elements (e.g. table, div, pre)\r
+ // at the end of document, makes it unable to continue adding content, we have to make this\r
+ // easier by opening an new empty paragraph.\r
+ var testRange = new CKEDITOR.dom.range( editor.document );\r
+ testRange.moveToElementEditEnd( editor.document.getBody() );\r
+ var testPath = new CKEDITOR.dom.elementPath( testRange.startContainer );\r
+ if ( !testPath.blockLimit.is( 'body') )\r