diff --git a/tests/manual/table.html b/tests/manual/table.html
index feae0e74..60a63c81 100644
--- a/tests/manual/table.html
+++ b/tests/manual/table.html
@@ -6,199 +6,18 @@
-
Complex table:
-
-
- Data about the planets of our solar system (Planetary facts taken from Nasa's Planetary Fact Sheet - Metric.
-
-
-
-
- |
- Name |
- Mass (1024kg) |
- Diameter (km) |
- Density (kg/m3) |
- Gravity (m/s2) |
- Length of day (hours) |
- Distance from Sun (106km) |
- Mean temperature (°C) |
- Number of moons |
- Notes |
-
-
-
-
- Terrestrial planets |
- Mercury |
- 0.330 |
- 4,879 |
- 5427 |
- 3.7 |
- 4222.6 |
- 57.9 |
- 167 |
- 0 |
- Closest to the Sun |
-
-
- Venus |
- 4.87 |
- 12,104 |
- 5243 |
- 8.9 |
- 2802.0 |
- 108.2 |
- 464 |
- 0 |
- |
-
-
- Earth |
- 5.97 |
- 12,756 |
- 5514 |
- 9.8 |
- 24.0 |
- 149.6 |
- 15 |
- 1 |
- Our world |
-
-
- Mars |
- 0.642 |
- 6,792 |
- 3933 |
- 3.7 |
- 24.7 |
- 227.9 |
- -65 |
- 2 |
- The red planet |
-
-
- Jovian planets |
- Gas giants |
- Jupiter |
- 1898 |
- 142,984 |
- 1326 |
- 23.1 |
- 9.9 |
- 778.6 |
- -110 |
- 67 |
- The largest planet |
-
-
- Saturn |
- 568 |
- 120,536 |
- 687 |
- 9.0 |
- 10.7 |
- 1433.5 |
- -140 |
- 62 |
- |
-
-
- Ice giants |
- Uranus |
- 86.8 |
- 51,118 |
- 1271 |
- 8.7 |
- 17.2 |
- 2872.5 |
- -195 |
- 27 |
- |
-
-
- Neptune |
- 102 |
- 49,528 |
- 1638 |
- 11.0 |
- 16.1 |
- 4495.1 |
- -200 |
- 14 |
- |
-
-
- Dwarf planets |
- Pluto |
- 0.0146 |
- 2,370 |
- 2095 |
- 0.7 |
- 153.3 |
- 5906.4 |
- -225 |
- 5 |
- Declassified as a planet in 2006, but this remains controversial.
- |
-
-
-
-
-
-
Table with 2 tbody:
-
-
-
- a |
- b |
- c |
-
-
-
a |
b |
c |
-
-
-
-
Table with no tbody:
-
-
-
-
Table with thead section between two tbody sections
-
-
-
-
- 2 |
-
-
-
-
- 1 |
-
-
-
-
- 3 |
-
-
+Model contents:
+
diff --git a/tests/manual/table.js b/tests/manual/table.js
index cf1c8ff1..53a9dd96 100644
--- a/tests/manual/table.js
+++ b/tests/manual/table.js
@@ -3,13 +3,14 @@
* For licensing, see LICENSE.md.
*/
-/* globals console, window, document */
+/* globals console, window, document, global */
import ClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
import ArticlePluginSet from '@ckeditor/ckeditor5-core/tests/_utils/articlepluginset';
import Table from '../../src/table';
import TableToolbar from '../../src/tabletoolbar';
import TableSelection from '../../src/tableselection';
+import { getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';
ClassicEditor
.create( document.querySelector( '#editor' ), {
@@ -23,7 +24,32 @@ ClassicEditor
} )
.then( editor => {
window.editor = editor;
+ editor.model.document.on( 'change', () => {
+ printModelContents( editor );
+ } );
+
+ printModelContents( editor );
} )
.catch( err => {
console.error( err.stack );
} );
+
+const modelDiv = global.document.querySelector( '#model' );
+
+function printModelContents( editor ) {
+ modelDiv.innerText = formatTable( getData( editor.model ) );
+}
+
+function formatTable( tableString ) {
+ return tableString
+ .replace( //g, '\n' )
+ .replace( //g, '\n\n ' )
+ .replace( //g, '\n\n ' )
+ .replace( //g, '\n\n ' )
+ .replace( //g, '\n
\n ' )
+ .replace( /<\/tableRow>/g, '\n' )
+ .replace( /<\/thead>/g, '\n' )
+ .replace( /<\/tbody>/g, '\n
' )
+ .replace( /<\/tr>/g, '\n' )
+ .replace( /<\/table>/g, '\n
' );
+}