Index: CKEditor/trunk/CHANGES.html
===================================================================
--- CKEditor/trunk/CHANGES.html	(revision 6955)
+++ CKEditor/trunk/CHANGES.html	(revision 6956)
@@ -72,4 +72,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/7742">#7742</a> : [WebKit] Indent doesn't apply on empty document without editor focus in prior.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/7801">#7801</a> : [Opera] Pasted paragraphs now split partial selected blocks.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/6663">#6663</a> : Table caption that contains rich text is not anymore corrupted after edit with table dialog.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/7834">#7834</a> : Dutch;</li>
Index: CKEditor/trunk/_source/plugins/table/dialogs/table.js
===================================================================
--- CKEditor/trunk/_source/plugins/table/dialogs/table.js	(revision 6955)
+++ CKEditor/trunk/_source/plugins/table/dialogs/table.js	(revision 6956)
@@ -117,9 +117,6 @@
 			onOk : function()
 			{
-				if ( this._.selectedElement )
-				{
-					var selection = editor.getSelection(),
-						bms = selection.createBookmarks();
-				}
+				var selection = editor.getSelection(),
+					bms = selection.createBookmarks();
 
 				var table = this._.selectedElement || makeElement( 'table' ),
@@ -249,7 +246,8 @@
 				if ( !this._.selectedElement )
 					editor.insertElement( table );
-				// Properly restore the selection inside table. (#4822)
-				else
-					selection.selectBookmarks( bms );
+
+				// Properly restore the selection, (#4822) but don't break
+				// because of this, e.g. updated table caption.
+				try { selection.selectBookmarks( bms ); } catch( er ){}
 
 				return true;
@@ -601,8 +599,21 @@
 									setup : function( selectedTable )
 									{
+										this.enable();
+
 										var nodeList = selectedTable.getElementsByTag( 'caption' );
 										if ( nodeList.count() > 0 )
 										{
 											var caption = nodeList.getItem( 0 );
+
+											var innerHtml = caption.getHtml().replace(/<br>\s*$/i, ''),
+												innerText = caption.getText();
+
+											if ( innerHtml != innerText )
+											{
+												this.disable();
+												this.setValue( innerText );
+												return;
+											}
+
 											caption = CKEDITOR.tools.trim( caption.getText() );
 											this.setValue( caption );
@@ -611,4 +622,7 @@
 									commit : function( data, table )
 									{
+										if ( !this.isEnabled() )
+											return;
+
 										var caption = this.getValue(),
 											captionElement = table.getElementsByTag( 'caption' );
