Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 6430)
+++ /CKEditor/trunk/CHANGES.html (revision 6431)
@@ -52,4 +52,5 @@
#6387 : AutoGrow may cause an error when editor instance is destroyed too quickly after height change.
#6901 : Mixed direction content was not properly respected on a shared toolbar.
+ #4809 : Table related tags are outputted in wrong order.
Updated the following language files:
- #7124 : Czech;
Index: /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js (revision 6430)
+++ /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js (revision 6431)
@@ -80,4 +80,7 @@
var dtd = CKEDITOR.dtd;
+
+ // Define orders of table elements.
+ var tableOrder = [ 'caption', 'colgroup', 'col', 'thead', 'tfoot', 'tbody' ];
// Find out the list of block-like tags that can contain
.
@@ -159,4 +162,15 @@
return element;
+ },
+
+ // The contents of table should be in correct order (#4809).
+ table : function( element )
+ {
+ var children = element.children;
+ children.sort( function ( node1, node2 )
+ {
+ return node1.type == CKEDITOR.NODE_ELEMENT && node2.type == node1.type ?
+ tableOrder.indexOf( node1.name ) > tableOrder.indexOf( node2.name ) ? 1 : -1 : 0;
+ } );
},