Ticket #5436: 5436_6.patch
File 5436_6.patch, 1.5 KB (added by , 13 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
16 16 // Matching an empty paragraph at the end of document. 17 17 var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center|li)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi; 18 18 19 var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true ); 20 19 21 function onInsertHtml( evt ) 20 22 { 21 23 if ( this.mode == 'wysiwyg' ) … … 129 131 130 132 range.moveToPosition( lastElement, CKEDITOR.POSITION_AFTER_END ); 131 133 132 var next = lastElement.getNextSourceNode( true ); 133 var lastElementIsInline = CKEDITOR.dtd.$inline[ lastElement.getName() ]; 134 if ( !lastElementIsInline && next && next.type == CKEDITOR.NODE_ELEMENT ) 135 range.moveToElementEditStart( next ); 134 // If we're inserting a block element immediatelly followed by 135 // another block element, the selection must move there. (#3100,#5436) 136 if ( isBlock ) 137 { 138 var next = lastElement.getNext( notWhitespaceEval ), 139 nextName = next && next.type == CKEDITOR.NODE_ELEMENT && next.getName(); 136 140 141 // Check if it's a block element that accepts text. 142 if ( nextName && CKEDITOR.dtd.$block[ nextName ] && CKEDITOR.dtd[ nextName ]['#'] ) 143 range.moveToElementEditStart( next ); 144 } 145 137 146 selection.selectRanges( [ range ] ); 138 147 139 148 if ( selIsLocked )