Ticket #5335: 5335.patch
File 5335.patch, 2.1 KB (added by , 14 years ago) |
---|
-
_source/plugins/list/plugin.js
279 279 { 280 280 var contentBlock = listContents.shift(), 281 281 listItem = doc.createElement( 'li' ); 282 contentBlock.moveChildren( listItem ); 283 contentBlock.remove();282 283 listItem = CKEDITOR.plugins.styles.replaceBlock( contentBlock, listItem, true ); 284 284 listItem.appendTo( listNode ); 285 285 286 286 // Append a bogus BR to force the LI to render at full height -
_source/plugins/styles/plugin.js
8 8 requires : [ 'selection' ] 9 9 }); 10 10 11 CKEDITOR.plugins.styles = {}; 12 11 13 /** 12 14 * Registers a function to be called whenever a style changes its state in the 13 15 * editing area. The current state is passed to the function. The possible … … 791 793 while ( ( block = iterator.getNextParagraph() ) ) // Only one = 792 794 { 793 795 var newBlock = getElement( this, doc ); 794 replaceBlock( block, newBlock );796 CKEDITOR.plugins.styles.replaceBlock( block, newBlock ); 795 797 } 796 798 797 799 range.moveToBookmark( bookmark ); … … 800 802 // Replace the original block with new one, with special treatment 801 803 // for <pre> blocks to make sure content format is well preserved, and merging/splitting adjacent 802 804 // when necessary.(#3188) 803 function replaceBlock( block, newBlock)805 CKEDITOR.plugins.styles.replaceBlock = function( block, newBlock, dontReplace ) 804 806 { 805 807 var newBlockIsPre = newBlock.is( 'pre' ); 806 808 var blockIsPre = block.is( 'pre' ); … … 816 818 else 817 819 block.moveChildren( newBlock ); 818 820 819 newBlock.replace( block );821 dontReplace ? block.remove() : newBlock.replace( block ); 820 822 821 823 if ( newBlockIsPre ) 822 824 { 823 825 // Merge previous <pre> blocks. 824 826 mergePre( newBlock ); 825 827 } 828 829 if ( dontReplace ) 830 return newBlock; 826 831 } 827 832 828 833 /**