Ticket #6479: 6479_2.patch
File 6479_2.patch, 2.0 KB (added by , 13 years ago) |
---|
-
_source/plugins/enterkey/plugin.js
115 115 newBlock = nextBlock.clone(); 116 116 117 117 if ( !newBlock ) 118 { 118 119 newBlock = doc.createElement( blockTag ); 120 previousBlock && previousBlock.hasAttribute( 'dir' ) && newBlock.setAttribute( 'dir', previousBlock.getAttribute( 'dir' ) ); 121 } 119 122 // Force the enter block unless we're talking of a list item. 120 123 else if ( forceMode && !newBlock.is( 'li' ) ) 121 124 newBlock.renameNode( blockTag ); … … 222 225 // If we are at the end of a header block. 223 226 if ( !forceMode && isEndOfBlock && headerTagRegex.test( startBlockTag ) ) 224 227 { 225 // Insert a <br> after the current paragraph. 226 doc.createElement( 'br' ).insertAfter( startBlock ); 228 var newBlock; 229 if ( startBlock.hasAttribute( 'dir' ) ) 230 { 231 newBlock = doc.createElement( 'div' ); 232 newBlock.setAttribute( 'dir', startBlock.getAttribute( 'dir' ) ); 233 newBlock.insertAfter( startBlock ); 234 range.setStart( newBlock, 0 ); 235 } 236 else 237 { 238 // Insert a <br> after the current paragraph. 239 doc.createElement( 'br' ).insertAfter( startBlock ); 227 240 228 // A text node is required by Gecko only to make the cursor blink.229 if ( CKEDITOR.env.gecko )230 doc.createText( '' ).insertAfter( startBlock );241 // A text node is required by Gecko only to make the cursor blink. 242 if ( CKEDITOR.env.gecko ) 243 doc.createText( '' ).insertAfter( startBlock ); 231 244 232 // IE has different behaviors regarding position. 233 range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START ); 245 // IE has different behaviors regarding position. 246 range.setStartAt( startBlock.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START ); 247 } 234 248 } 235 249 else 236 250 {