Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 6090)
+++ /CKEditor/trunk/CHANGES.html (revision 6091)
@@ -53,4 +53,5 @@
#6510 : Margin mirroring doesn't respect style configuration.
#6471 : BIDI: Pressing decrease indent in an RTL bulleted list causes incorrect behaviour.
+ #6479 : BIDI: Language direction is not being preserved when pressing Enter after a paragraph format has been applied.
Index: /CKEditor/trunk/_source/plugins/enterkey/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/enterkey/plugin.js (revision 6090)
+++ /CKEditor/trunk/_source/plugins/enterkey/plugin.js (revision 6091)
@@ -99,5 +99,6 @@
else
{
- var newBlock;
+ var newBlock,
+ newBlockDir;
if ( previousBlock )
@@ -116,5 +117,9 @@
if ( !newBlock )
+ {
newBlock = doc.createElement( blockTag );
+ if ( previousBlock && ( newBlockDir = previousBlock.getDirection() ) )
+ newBlock.setAttribute( 'dir', newBlockDir );
+ }
// Force the enter block unless we're talking of a list item.
else if ( forceMode && !newBlock.is( 'li' ) )
@@ -223,13 +228,26 @@
if ( !forceMode && isEndOfBlock && headerTagRegex.test( startBlockTag ) )
{
- // Insert a
after the current paragraph.
- doc.createElement( 'br' ).insertAfter( startBlock );
-
- // A text node is required by Gecko only to make the cursor blink.
- if ( CKEDITOR.env.gecko )
- doc.createText( '' ).insertAfter( startBlock );
-
- // IE has different behaviors regarding position.
- range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START );
+ var newBlock,
+ newBlockDir;
+
+ if ( newBlockDir = startBlock.getDirection() )
+ {
+ newBlock = doc.createElement( 'div' );
+ newBlock.setAttribute( 'dir', newBlockDir );
+ newBlock.insertAfter( startBlock );
+ range.setStart( newBlock, 0 );
+ }
+ else
+ {
+ // Insert a
after the current paragraph.
+ doc.createElement( 'br' ).insertAfter( startBlock );
+
+ // A text node is required by Gecko only to make the cursor blink.
+ if ( CKEDITOR.env.gecko )
+ doc.createText( '' ).insertAfter( startBlock );
+
+ // IE has different behaviors regarding position.
+ range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START );
+ }
}
else