Ticket #3782: 3782.patch
File 3782.patch, 1.4 KB (added by , 14 years ago) |
---|
-
_source/plugins/list/plugin.js
11 11 { 12 12 var listNodeNames = { ol : 1, ul : 1 }, 13 13 emptyTextRegex = /^[\n\r\t ]*$/; 14 var dtd = CKEDITOR.dtd; 15 var blockLikeTags = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ); 14 16 15 17 CKEDITOR.plugins.list = { 16 18 /* … … 335 337 } 336 338 337 339 var newList = CKEDITOR.plugins.list.arrayToList( listArray, database, null, editor.config.enterMode ); 340 338 341 // If groupObj.root is the last element in its parent, or its nextSibling is a <br>, then we should 339 342 // not add a <br> after the final item. So, check for the cases and trim the <br>. 340 343 if ( !groupObj.root.getNext() || groupObj.root.getNext().$.nodeName.toLowerCase() == 'br' ) … … 342 345 if ( newList.listNode.getLast().$.nodeName.toLowerCase() == 'br' ) 343 346 newList.listNode.getLast().remove(); 344 347 } 348 349 var parentNode = groupObj.root.getParent(); 345 350 newList.listNode.replace( groupObj.root ); 351 352 // If groupObj.root's parent is a block, we might have removed the filler BR node at the line above. 353 // So put it back if needed. (#3782) 354 if ( parentNode && blockLikeTags[ parentNode.getName() ] ) 355 parentNode.appendBogus(); 346 356 } 347 357 348 358 function listCommand( name, type )