Ticket #3664: 3664.patch
File 3664.patch, 2.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
79 79 // If we're inserting a block at dtd-violated positoin, split 80 80 // the parent blocks until we reach blockLimit. 81 81 var parent, dtd; 82 if ( this.config.enterMode != CKEDITOR.ENTER_BR &&isBlock )82 if ( isBlock ) 83 83 while( ( parent = range.getCommonAncestor( false, true ) ) 84 84 && ( dtd = CKEDITOR.dtd[ parent.getName() ] ) 85 85 && !( dtd && dtd [ elementName ] ) ) 86 range.splitBlock(); 86 { 87 // If we're in an 'blank' block, just replace it later 88 // by the new block.(#3664) 89 var children, count, firstChild; 90 if ( this.config.enterMode != CKEDITOR.ENTER_BR 91 && parent.getName() in CKEDITOR.dtd.$block 92 && ( children = parent.getChildren() ) 93 && ( ( count = children.count() ) || true ) 94 && ( !count || 95 count == 1 96 && ( firstChild = children.getItem( 0 ) ) 97 && firstChild.is && firstChild.is( 'br' ) ) ) 98 { 99 range.setStartBefore( parent ); 100 range.collapse( true ); 101 parent.remove(); 102 } 103 else 104 range.splitBlock(); 105 } 87 106 88 107 // Insert the new node. 89 108 range.insertNode( clone ); -
_source/plugins/domiterator/plugin.js
62 62 { 63 63 this._.lastNode = range.document.createText( '' ); 64 64 this._.lastNode.insertAfter( lastNode ); 65 this._.lastNode.isDirty = true; 65 66 } 66 67 // Let's reuse this variable. 67 68 range = null; … … 208 209 if ( !range ) 209 210 { 210 211 this._.nextNode = null; 212 213 // We've finished the iteration, remove the last node on dirty. 214 if ( this._.lastNode.isDirty ) 215 this._.lastNode.remove(); 216 211 217 return null; 212 218 } 213 219 … … 304 310 this._.nextNode = ( isLast || block.equals( lastNode ) ) ? null : 305 311 block.getNextSourceNode( true, null, lastNode ); 306 312 } 307 313 308 314 return block; 309 315 } 310 316 };