Ticket #3664: 3664_2.patch
File 3664_2.patch, 1.3 KB (added by , 14 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
81 81 82 82 // If we're inserting a block at dtd-violated position, split 83 83 // the parent blocks until we reach blockLimit. 84 var parent, dtd; 85 if ( this.config.enterMode != CKEDITOR.ENTER_BR && isBlock ) 86 { 87 while( ( parent = range.getCommonAncestor( false, true ) ) 88 && ( dtd = CKEDITOR.dtd[ parent.getName() ] ) 84 var current, dtd; 85 if ( isBlock ) 86 while( ( current = range.getCommonAncestor( false, true ) ) 87 && ( dtd = CKEDITOR.dtd[ current.getName() ] ) 89 88 && !( dtd && dtd [ elementName ] ) ) 90 89 { 91 range.splitBlock(); 90 // If we're in an 'blank' block, just replace it later 91 // by the new block.(#3664) 92 var children, count, firstChild; 93 if ( range.checkStartOfBlock() 94 && range.checkEndOfBlock() ) 95 { 96 range.setStartBefore( current ); 97 range.collapse( true ); 98 current.remove(); 99 } 100 else 101 range.splitBlock(); 92 102 } 93 }94 103 95 104 // Insert the new node. 96 105 range.insertNode( clone );