Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html (revision 5901)
+++ /CKEditor/trunk/CHANGES.html (revision 5902)
@@ -46,4 +46,5 @@
- #5237 : English text in dialogs' title was flipped when using RTL language (office2003 and v2 skins).
+ - #6289 : Deleting nested table removed the parent cell.
Index: /CKEditor/trunk/_source/plugins/tabletools/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/tabletools/plugin.js (revision 5901)
+++ /CKEditor/trunk/_source/plugins/tabletools/plugin.js (revision 5902)
@@ -715,7 +715,7 @@
exec : function( editor )
{
- var selection = editor.getSelection();
- var startElement = selection && selection.getStartElement();
- var table = startElement && startElement.getAscendant( 'table', true );
+ var selection = editor.getSelection(),
+ startElement = selection && selection.getStartElement(),
+ table = startElement && startElement.getAscendant( 'table', 1 );
if ( !table )
@@ -728,7 +728,7 @@
selection.selectRanges( [ range ] );
- // If the table's parent has only one child, remove it,except body,as well.( #5416 )
+ // If the table's parent has only one child remove it as well (unless it's the body or a table cell) (#5416, #6289)
var parent = table.getParent();
- if ( parent.getChildCount() == 1 && parent.getName() != 'body' )
+ if ( parent.getChildCount() == 1 && !parent.is( 'body', 'td', 'th' ) )
parent.remove();
else