Ticket #4809: 4809_2.patch
File 4809_2.patch, 1.2 KB (added by , 13 years ago) |
---|
-
_source/plugins/htmldataprocessor/plugin.js
80 80 81 81 var dtd = CKEDITOR.dtd; 82 82 83 // Define orders of table elements. 84 var tableOrder = [ 'caption', 'colgroup', 'col', 'thead', 'tbody', 'tfoot' ]; 85 86 83 87 // Find out the list of block-like tags that can contain <br>. 84 88 var blockLikeTags = CKEDITOR.tools.extend( {}, dtd.$block, dtd.$listItem, dtd.$tableContent ); 85 89 for ( var i in blockLikeTags ) … … 160 164 return element; 161 165 }, 162 166 167 // The contents of table should be in correct order (#4809). 168 table : function( element ) 169 { 170 var children = element.children; 171 children.sort( function ( node1, node2 ) 172 { 173 return node1.type == CKEDITOR.NODE_ELEMENT && node2.type == node1.type ? 174 tableOrder.indexOf( node1.name ) > tableOrder.indexOf( node2.name ) ? 1 : -1 : 0; 175 } ); 176 }, 177 163 178 embed : function( element ) 164 179 { 165 180 var parent = element.parent;