Ticket #6432: 6432_3.patch
File 6432_3.patch, 1.4 KB (added by , 14 years ago) |
---|
-
_source/plugins/wysiwygarea/plugin.js
144 144 145 145 // If we're inserting a block at dtd-violated position, split 146 146 // the parent blocks until we reach blockLimit. 147 var current, dtd ;147 var current, dtd, lists = { ol:1, ul:1 }; 148 148 if ( isBlock ) 149 149 { 150 150 while ( ( current = range.getCommonAncestor( 0, 1 ) ) 151 151 && ( dtd = CKEDITOR.dtd[ current.getName() ] ) 152 152 && !( dtd && dtd [ elementName ] ) ) 153 153 { 154 var boundary = range.getBoundaryNodes(); 155 154 156 // Split up inline elements. 155 157 if ( current.getName() in CKEDITOR.dtd.span ) 156 158 range.splitElement( current ); … … 163 165 range.collapse( true ); 164 166 current.remove(); 165 167 } 168 else if ( current.getName() in lists && boundary.startNode.is( 'li' ) && boundary.endNode.is( 'li' ) ) 169 { 170 var sibling = boundary.startNode; 171 while ( sibling = sibling.getNext() ) 172 { 173 sibling.remove(); 174 if ( sibling.equals( boundary.endNode ) ) 175 break; 176 } 177 178 range.setStartAt( boundary.startNode, CKEDITOR.POSITION_AFTER_START ); 179 range.setEndAt( boundary.startNode, CKEDITOR.POSITION_BEFORE_END ); 180 } 166 181 else 167 182 range.splitBlock(); 168 183 }