- // Determine the block element to be used.\r
- var blockTag = ( mode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );\r
+ range.deleteContents();\r
+ range.insertNode( lineBreak );\r
+\r
+ // A text node is required by Gecko only to make the cursor blink.\r
+ // We need some text inside of it, so the bogus <br> is properly\r
+ // created.\r
+ if ( !CKEDITOR.env.ie )\r
+ doc.createText( '\ufeff' ).insertAfter( lineBreak );\r
+\r
+ // If we are at the end of a block, we must be sure the bogus node is available in that block.\r
+ if ( isEndOfBlock && !CKEDITOR.env.ie )\r
+ lineBreak.getParent().appendBogus();\r
+\r
+ // Now we can remove the text node contents, so the caret doesn't\r
+ // stop on it.\r
+ if ( !CKEDITOR.env.ie )\r
+ lineBreak.getNext().$.nodeValue = '';\r
+ // IE has different behavior regarding position.\r
+ if ( CKEDITOR.env.ie )\r
+ range.setStartAt( lineBreak, CKEDITOR.POSITION_AFTER_END );\r
+ else\r
+ range.setStartAt( lineBreak.getNext(), CKEDITOR.POSITION_AFTER_START );\r