if ( node.is( 'li' ) )\r
{\r
nextBlock.breakParent( node );\r
- nextBlock.move( nextBlock.getNext(), true );\r
+ nextBlock.move( nextBlock.getNext(), 1 );\r
}\r
}\r
else if ( previousBlock && ( node = previousBlock.getParent() ) && node.is( 'li' ) )\r
}\r
else\r
{\r
- var newBlock;\r
+ var newBlock,\r
+ newBlockDir;\r
\r
if ( previousBlock )\r
{\r
newBlock = nextBlock.clone();\r
\r
if ( !newBlock )\r
+ {\r
newBlock = doc.createElement( blockTag );\r
+ if ( previousBlock && ( newBlockDir = previousBlock.getDirection() ) )\r
+ newBlock.setAttribute( 'dir', newBlockDir );\r
+ }\r
// Force the enter block unless we're talking of a list item.\r
else if ( forceMode && !newBlock.is( 'li' ) )\r
newBlock.renameNode( blockTag );\r
// If we are at the end of a header block.\r
if ( !forceMode && isEndOfBlock && headerTagRegex.test( startBlockTag ) )\r
{\r
- // Insert a <br> after the current paragraph.\r
- doc.createElement( 'br' ).insertAfter( startBlock );\r
+ var newBlock,\r
+ newBlockDir;\r
\r
- // A text node is required by Gecko only to make the cursor blink.\r
- if ( CKEDITOR.env.gecko )\r
- doc.createText( '' ).insertAfter( startBlock );\r
+ if ( newBlockDir = startBlock.getDirection() )\r
+ {\r
+ newBlock = doc.createElement( 'div' );\r
+ newBlock.setAttribute( 'dir', newBlockDir );\r
+ newBlock.insertAfter( startBlock );\r
+ range.setStart( newBlock, 0 );\r
+ }\r
+ else\r
+ {\r
+ // Insert a <br> after the current paragraph.\r
+ doc.createElement( 'br' ).insertAfter( startBlock );\r
\r
- // IE has different behaviors regarding position.\r
- range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START );\r
+ // A text node is required by Gecko only to make the cursor blink.\r
+ if ( CKEDITOR.env.gecko )\r
+ doc.createText( '' ).insertAfter( startBlock );\r
+\r
+ // IE has different behaviors regarding position.\r
+ range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START );\r
+ }\r
}\r
else\r
{\r
return true;\r
}\r
else\r
- return enter( editor, editor.config.shiftEnterMode, true );\r
+ return enter( editor, editor.config.shiftEnterMode, 1 );\r
}\r
\r
function enter( editor, mode, forceMode )\r
setTimeout( function()\r
{\r
editor.fire( 'saveSnapshot' ); // Save undo step.\r
- if ( mode == CKEDITOR.ENTER_BR || editor.getSelection().getStartElement().hasAscendant( 'pre', true ) )\r
+ if ( mode == CKEDITOR.ENTER_BR || editor.getSelection().getStartElement().hasAscendant( 'pre', 1 ) )\r
enterBr( editor, mode, null, forceMode );\r
else\r
enterBlock( editor, mode, null, forceMode );\r