diff --git a/packages/block-library/src/table/block.json b/packages/block-library/src/table/block.json
index 44177ef50a7e20..11dd5b5f323e3b 100644
--- a/packages/block-library/src/table/block.json
+++ b/packages/block-library/src/table/block.json
@@ -9,7 +9,7 @@
"attributes": {
"hasFixedLayout": {
"type": "boolean",
- "default": false
+ "default": true
},
"caption": {
"type": "rich-text",
diff --git a/packages/block-library/src/table/deprecated.js b/packages/block-library/src/table/deprecated.js
index ed138c4518aa31..43d4b0098a02f5 100644
--- a/packages/block-library/src/table/deprecated.js
+++ b/packages/block-library/src/table/deprecated.js
@@ -12,6 +12,7 @@ import {
useBlockProps,
__experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles,
__experimentalGetColorClassesAndStyles as getColorClassesAndStyles,
+ __experimentalGetElementClassName,
} from '@wordpress/block-editor';
// As the previous arbitrary colors won't match theme color palettes, the hex
@@ -24,8 +25,266 @@ const oldColors = {
'subtle-pale-pink': '#fcf0ef',
};
+// Fixed width table cells on by default.
+const v4Query = {
+ content: {
+ type: 'rich-text',
+ source: 'rich-text',
+ },
+ tag: {
+ type: 'string',
+ default: 'td',
+ source: 'tag',
+ },
+ scope: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'scope',
+ },
+ align: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'data-align',
+ },
+ colspan: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'colspan',
+ },
+ rowspan: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'rowspan',
+ },
+};
+
+const v4 = {
+ attributes: {
+ hasFixedLayout: {
+ type: 'boolean',
+ default: false,
+ },
+ caption: {
+ type: 'rich-text',
+ source: 'rich-text',
+ selector: 'figcaption',
+ },
+ head: {
+ type: 'array',
+ default: [],
+ source: 'query',
+ selector: 'thead tr',
+ query: {
+ cells: {
+ type: 'array',
+ default: [],
+ source: 'query',
+ selector: 'td,th',
+ query: v4Query,
+ },
+ },
+ },
+ body: {
+ type: 'array',
+ default: [],
+ source: 'query',
+ selector: 'tbody tr',
+ query: {
+ cells: {
+ type: 'array',
+ default: [],
+ source: 'query',
+ selector: 'td,th',
+ query: v4Query,
+ },
+ },
+ },
+ foot: {
+ type: 'array',
+ default: [],
+ source: 'query',
+ selector: 'tfoot tr',
+ query: {
+ cells: {
+ type: 'array',
+ default: [],
+ source: 'query',
+ selector: 'td,th',
+ query: v4Query,
+ },
+ },
+ },
+ },
+ supports: {
+ anchor: true,
+ align: true,
+ color: {
+ __experimentalSkipSerialization: true,
+ gradients: true,
+ __experimentalDefaultControls: {
+ background: true,
+ text: true,
+ },
+ },
+ spacing: {
+ margin: true,
+ padding: true,
+ __experimentalDefaultControls: {
+ margin: false,
+ padding: false,
+ },
+ },
+ typography: {
+ fontSize: true,
+ lineHeight: true,
+ __experimentalFontFamily: true,
+ __experimentalFontStyle: true,
+ __experimentalFontWeight: true,
+ __experimentalLetterSpacing: true,
+ __experimentalTextTransform: true,
+ __experimentalTextDecoration: true,
+ __experimentalDefaultControls: {
+ fontSize: true,
+ },
+ },
+ __experimentalBorder: {
+ __experimentalSkipSerialization: true,
+ color: true,
+ style: true,
+ width: true,
+ __experimentalDefaultControls: {
+ color: true,
+ style: true,
+ width: true,
+ },
+ },
+ __experimentalSelector: '.wp-block-table > table',
+ interactivity: {
+ clientNavigation: true,
+ },
+ },
+ save( { attributes } ) {
+ const { hasFixedLayout, head, body, foot, caption } = attributes;
+ const isEmpty = ! head.length && ! body.length && ! foot.length;
+
+ if ( isEmpty ) {
+ return null;
+ }
+
+ const colorProps = getColorClassesAndStyles( attributes );
+ const borderProps = getBorderClassesAndStyles( attributes );
+
+ const classes = classnames(
+ colorProps.className,
+ borderProps.className,
+ {
+ 'has-fixed-layout': hasFixedLayout,
+ }
+ );
+
+ const hasCaption = ! RichText.isEmpty( caption );
+
+ const Section = ( { type, rows } ) => {
+ if ( ! rows.length ) {
+ return null;
+ }
+
+ const Tag = `t${ type }`;
+
+ return (
+
+ { rows.map( ( { cells }, rowIndex ) => (
+
+ { cells.map(
+ (
+ {
+ content,
+ tag,
+ scope,
+ align,
+ colspan,
+ rowspan,
+ },
+ cellIndex
+ ) => {
+ const cellClasses = classnames( {
+ [ `has-text-align-${ align }` ]: align,
+ } );
+
+ return (
+
+ );
+ }
+ ) }
+
+ ) ) }
+
+ );
+ };
+
+ return (
+
+
+ { hasCaption && (
+
+ ) }
+
+ );
+ },
+};
+
// In #41140 support was added to global styles for caption elements which
// added a `wp-element-caption` classname to the embed figcaption element.
+const v3Query = {
+ content: {
+ type: 'string',
+ source: 'html',
+ },
+ tag: {
+ type: 'string',
+ default: 'td',
+ source: 'tag',
+ },
+ scope: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'scope',
+ },
+ align: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'data-align',
+ },
+};
+
const v3 = {
attributes: {
hasFixedLayout: {
@@ -49,27 +308,7 @@ const v3 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align',
- },
- },
+ query: v3Query,
},
},
},
@@ -84,27 +323,7 @@ const v3 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align',
- },
- },
+ query: v3Query,
},
},
},
@@ -119,27 +338,7 @@ const v3 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align',
- },
- },
+ query: v3Query,
},
},
},
@@ -269,6 +468,28 @@ const v3 = {
};
// Deprecation migrating table block to use colors block support feature.
+const v2Query = {
+ content: {
+ type: 'string',
+ source: 'html',
+ },
+ tag: {
+ type: 'string',
+ default: 'td',
+ source: 'tag',
+ },
+ scope: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'scope',
+ },
+ align: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'data-align',
+ },
+};
+
const v2 = {
attributes: {
hasFixedLayout: {
@@ -295,27 +516,7 @@ const v2 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align',
- },
- },
+ query: v2Query,
},
},
},
@@ -330,27 +531,7 @@ const v2 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align',
- },
- },
+ query: v2Query,
},
},
},
@@ -365,27 +546,7 @@ const v2 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- align: {
- type: 'string',
- source: 'attribute',
- attribute: 'data-align',
- },
- },
+ query: v2Query,
},
},
},
@@ -496,6 +657,23 @@ const v2 = {
},
};
+const v1Query = {
+ content: {
+ type: 'string',
+ source: 'html',
+ },
+ tag: {
+ type: 'string',
+ default: 'td',
+ source: 'tag',
+ },
+ scope: {
+ type: 'string',
+ source: 'attribute',
+ attribute: 'scope',
+ },
+};
+
const v1 = {
attributes: {
hasFixedLayout: {
@@ -516,22 +694,7 @@ const v1 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- },
+ query: v1Query,
},
},
},
@@ -546,22 +709,7 @@ const v1 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- },
+ query: v1Query,
},
},
},
@@ -576,22 +724,7 @@ const v1 = {
default: [],
source: 'query',
selector: 'td,th',
- query: {
- content: {
- type: 'string',
- source: 'html',
- },
- tag: {
- type: 'string',
- default: 'td',
- source: 'tag',
- },
- scope: {
- type: 'string',
- source: 'attribute',
- attribute: 'scope',
- },
- },
+ query: v1Query,
},
},
},
@@ -665,4 +798,4 @@ const v1 = {
*
* See block-deprecation.md
*/
-export default [ v3, v2, v1 ];
+export default [ v4, v3, v2, v1 ];
diff --git a/packages/blocks/src/api/raw-handling/test/paste-handler.js b/packages/blocks/src/api/raw-handling/test/paste-handler.js
index ffd98fd4dadab7..40a28f3c35a33f 100644
--- a/packages/blocks/src/api/raw-handling/test/paste-handler.js
+++ b/packages/blocks/src/api/raw-handling/test/paste-handler.js
@@ -77,7 +77,7 @@ describe( 'pasteHandler', () => {
delete result.attributes.caption;
expect( result.attributes ).toEqual( {
- hasFixedLayout: false,
+ hasFixedLayout: true,
head: [
{
cells: [
@@ -117,7 +117,7 @@ describe( 'pasteHandler', () => {
delete result.attributes.caption;
expect( result.attributes ).toEqual( {
- hasFixedLayout: false,
+ hasFixedLayout: true,
head: [
{
cells: [
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-a-caption-to-be-added-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-a-caption-to-be-added-1-chromium.txt
index 144b62e5e5341f..cf4c71986ba857 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-a-caption-to-be-added-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-a-caption-to-be-added-1-chromium.txt
@@ -1,3 +1,3 @@
-Caption!
+Caption!
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-1-chromium.txt
index 12024dcd6a8a09..c29304a4c7480e 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-1-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-2-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-2-chromium.txt
index 867cde963258b7..c17f3e08254169 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-2-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-adding-and-deleting-columns-across-the-table-header-body-and-footer-2-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-cells-to-be-selected-when-the-cell-area-outside-of-the-RichText-is-clicked-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-cells-to-be-selected-when-the-cell-area-outside-of-the-RichText-is-clicked-1-chromium.txt
index 6be90e739c1bb5..06a2ec73cd7e92 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-cells-to-be-selected-when-the-cell-area-outside-of-the-RichText-is-clicked-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-cells-to-be-selected-when-the-cell-area-outside-of-the-RichText-is-clicked-1-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-columns-to-be-aligned-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-columns-to-be-aligned-1-chromium.txt
index 6986d5c5b54cd5..fbc0a773057dc4 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-columns-to-be-aligned-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-columns-to-be-aligned-1-chromium.txt
@@ -1,3 +1,3 @@
-None To the left Centered Right aligned
+None To the left Centered Right aligned
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-1-chromium.txt
index 467ab42d768051..1d20e6018be8d6 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-1-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-2-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-2-chromium.txt
index 0aa0e667b7141d..8fbd8207d2f1a4 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-2-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-header-and-footer-rows-to-be-switched-on-and-off-2-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-text-to-by-typed-into-cells-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-text-to-by-typed-into-cells-1-chromium.txt
index adce67703575d2..80c17e6de4f55f 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-text-to-by-typed-into-cells-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-allows-text-to-by-typed-into-cells-1-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-displays-a-form-for-choosing-the-row-and-column-count-of-the-table-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-displays-a-form-for-choosing-the-row-and-column-count-of-the-table-1-chromium.txt
index 39b6f395f28ada..3688278430c929 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-displays-a-form-for-choosing-the-row-and-column-count-of-the-table-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-displays-a-form-for-choosing-the-row-and-column-count-of-the-table-1-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/blocks/__snapshots__/Table-up-and-down-arrow-navigation-1-chromium.txt b/test/e2e/specs/editor/blocks/__snapshots__/Table-up-and-down-arrow-navigation-1-chromium.txt
index ea42038e553f94..9c0a994f5d294d 100644
--- a/test/e2e/specs/editor/blocks/__snapshots__/Table-up-and-down-arrow-navigation-1-chromium.txt
+++ b/test/e2e/specs/editor/blocks/__snapshots__/Table-up-and-down-arrow-navigation-1-chromium.txt
@@ -1,3 +1,3 @@
-
+
\ No newline at end of file
diff --git a/test/e2e/specs/editor/various/writing-flow.spec.js b/test/e2e/specs/editor/various/writing-flow.spec.js
index 1022e636345b88..ae46a478218e87 100644
--- a/test/e2e/specs/editor/various/writing-flow.spec.js
+++ b/test/e2e/specs/editor/various/writing-flow.spec.js
@@ -923,7 +923,7 @@ test.describe( 'Writing Flow (@firefox, @webkit)', () => {
// Confirm correct setup.
await expect.poll( editor.getEditedPostContent )
.toBe( `
-
+
` );
} );
diff --git a/test/integration/fixtures/blocks/core__table.html b/test/integration/fixtures/blocks/core__table.html
index 7cc12a4efb3b5b..3ea74325cfb8c1 100644
--- a/test/integration/fixtures/blocks/core__table.html
+++ b/test/integration/fixtures/blocks/core__table.html
@@ -1,3 +1,3 @@
-Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
diff --git a/test/integration/fixtures/blocks/core__table.json b/test/integration/fixtures/blocks/core__table.json
index a694b52a94c390..015e57d8a45d7d 100644
--- a/test/integration/fixtures/blocks/core__table.json
+++ b/test/integration/fixtures/blocks/core__table.json
@@ -3,7 +3,7 @@
"name": "core/table",
"isValid": true,
"attributes": {
- "hasFixedLayout": false,
+ "hasFixedLayout": true,
"caption": "",
"head": [
{
diff --git a/test/integration/fixtures/blocks/core__table.parsed.json b/test/integration/fixtures/blocks/core__table.parsed.json
index 7bf372efab4c0a..c93936d8343ba9 100644
--- a/test/integration/fixtures/blocks/core__table.parsed.json
+++ b/test/integration/fixtures/blocks/core__table.parsed.json
@@ -3,9 +3,9 @@
"blockName": "core/table",
"attrs": {},
"innerBlocks": [],
- "innerHTML": "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n",
+ "innerHTML": "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n",
"innerContent": [
- "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n"
+ "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n"
]
}
]
diff --git a/test/integration/fixtures/blocks/core__table.serialized.html b/test/integration/fixtures/blocks/core__table.serialized.html
index 95fc72534da7db..0a8200ad804bda 100644
--- a/test/integration/fixtures/blocks/core__table.serialized.html
+++ b/test/integration/fixtures/blocks/core__table.serialized.html
@@ -1,3 +1,3 @@
-Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
diff --git a/test/integration/fixtures/blocks/core__table__caption.html b/test/integration/fixtures/blocks/core__table__caption.html
index 110d0695e5a937..26bf3950799d99 100644
--- a/test/integration/fixtures/blocks/core__table__caption.html
+++ b/test/integration/fixtures/blocks/core__table__caption.html
@@ -1,3 +1,3 @@
-Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing
diff --git a/test/integration/fixtures/blocks/core__table__caption.json b/test/integration/fixtures/blocks/core__table__caption.json
index 4f500a7691fa8a..ca284f20bdfa74 100644
--- a/test/integration/fixtures/blocks/core__table__caption.json
+++ b/test/integration/fixtures/blocks/core__table__caption.json
@@ -3,7 +3,7 @@
"name": "core/table",
"isValid": true,
"attributes": {
- "hasFixedLayout": false,
+ "hasFixedLayout": true,
"caption": "A table for testing",
"head": [
{
diff --git a/test/integration/fixtures/blocks/core__table__caption.parsed.json b/test/integration/fixtures/blocks/core__table__caption.parsed.json
index 531c2d7e605c6f..bd6f605085e6f1 100644
--- a/test/integration/fixtures/blocks/core__table__caption.parsed.json
+++ b/test/integration/fixtures/blocks/core__table__caption.parsed.json
@@ -3,9 +3,9 @@
"blockName": "core/table",
"attrs": {},
"innerBlocks": [],
- "innerHTML": "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing \n",
+ "innerHTML": "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing \n",
"innerContent": [
- "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing \n"
+ "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing \n"
]
}
]
diff --git a/test/integration/fixtures/blocks/core__table__caption.serialized.html b/test/integration/fixtures/blocks/core__table__caption.serialized.html
index 66246c83295a9e..3cff780e78c3a6 100644
--- a/test/integration/fixtures/blocks/core__table__caption.serialized.html
+++ b/test/integration/fixtures/blocks/core__table__caption.serialized.html
@@ -1,3 +1,3 @@
-Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing
diff --git a/test/integration/fixtures/blocks/core__table__deprecated-1.serialized.html b/test/integration/fixtures/blocks/core__table__deprecated-1.serialized.html
index 061aa7a2248b10..3f72ff591d56e7 100644
--- a/test/integration/fixtures/blocks/core__table__deprecated-1.serialized.html
+++ b/test/integration/fixtures/blocks/core__table__deprecated-1.serialized.html
@@ -1,3 +1,3 @@
-
+
Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
Table Caption
diff --git a/test/integration/fixtures/blocks/core__table__deprecated-2.serialized.html b/test/integration/fixtures/blocks/core__table__deprecated-2.serialized.html
index 95fc72534da7db..2ee8e6d7345433 100644
--- a/test/integration/fixtures/blocks/core__table__deprecated-2.serialized.html
+++ b/test/integration/fixtures/blocks/core__table__deprecated-2.serialized.html
@@ -1,3 +1,3 @@
-
+
Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
diff --git a/test/integration/fixtures/blocks/core__table__deprecated-3.serialized.html b/test/integration/fixtures/blocks/core__table__deprecated-3.serialized.html
index 66246c83295a9e..3f2f2b362e378c 100644
--- a/test/integration/fixtures/blocks/core__table__deprecated-3.serialized.html
+++ b/test/integration/fixtures/blocks/core__table__deprecated-3.serialized.html
@@ -1,3 +1,3 @@
-
+
Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing
diff --git a/test/integration/fixtures/blocks/core__table__deprecated-4.html b/test/integration/fixtures/blocks/core__table__deprecated-4.html
new file mode 100644
index 00000000000000..a22436c55bdb1f
--- /dev/null
+++ b/test/integration/fixtures/blocks/core__table__deprecated-4.html
@@ -0,0 +1,3 @@
+
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing
+
diff --git a/test/integration/fixtures/blocks/core__table__deprecated-4.json b/test/integration/fixtures/blocks/core__table__deprecated-4.json
new file mode 100644
index 00000000000000..4f500a7691fa8a
--- /dev/null
+++ b/test/integration/fixtures/blocks/core__table__deprecated-4.json
@@ -0,0 +1,144 @@
+[
+ {
+ "name": "core/table",
+ "isValid": true,
+ "attributes": {
+ "hasFixedLayout": false,
+ "caption": "A table for testing",
+ "head": [
+ {
+ "cells": [
+ {
+ "content": "Version",
+ "tag": "th"
+ },
+ {
+ "content": "Musician",
+ "tag": "th"
+ },
+ {
+ "content": "Date",
+ "tag": "th"
+ }
+ ]
+ }
+ ],
+ "body": [
+ {
+ "cells": [
+ {
+ "content": ".70 ",
+ "tag": "td"
+ },
+ {
+ "content": "No musician chosen.",
+ "tag": "td"
+ },
+ {
+ "content": "May 27, 2003",
+ "tag": "td"
+ }
+ ]
+ },
+ {
+ "cells": [
+ {
+ "content": "1.0 ",
+ "tag": "td"
+ },
+ {
+ "content": "Miles Davis",
+ "tag": "td"
+ },
+ {
+ "content": "January 3, 2004",
+ "tag": "td"
+ }
+ ]
+ },
+ {
+ "cells": [
+ {
+ "content": "Lots of versions skipped, see the full list ",
+ "tag": "td"
+ },
+ {
+ "content": "…",
+ "tag": "td"
+ },
+ {
+ "content": "…",
+ "tag": "td"
+ }
+ ]
+ },
+ {
+ "cells": [
+ {
+ "content": "4.4 ",
+ "tag": "td"
+ },
+ {
+ "content": "Clifford Brown",
+ "tag": "td"
+ },
+ {
+ "content": "December 8, 2015",
+ "tag": "td"
+ }
+ ]
+ },
+ {
+ "cells": [
+ {
+ "content": "4.5 ",
+ "tag": "td"
+ },
+ {
+ "content": "Coleman Hawkins",
+ "tag": "td"
+ },
+ {
+ "content": "April 12, 2016",
+ "tag": "td"
+ }
+ ]
+ },
+ {
+ "cells": [
+ {
+ "content": "4.6 ",
+ "tag": "td"
+ },
+ {
+ "content": "Pepper Adams",
+ "tag": "td"
+ },
+ {
+ "content": "August 16, 2016",
+ "tag": "td"
+ }
+ ]
+ },
+ {
+ "cells": [
+ {
+ "content": "4.7 ",
+ "tag": "td"
+ },
+ {
+ "content": "Sarah Vaughan",
+ "tag": "td"
+ },
+ {
+ "content": "December 6, 2016",
+ "tag": "td"
+ }
+ ]
+ }
+ ],
+ "foot": []
+ },
+ "innerBlocks": []
+ }
+]
diff --git a/test/integration/fixtures/blocks/core__table__deprecated-4.parsed.json b/test/integration/fixtures/blocks/core__table__deprecated-4.parsed.json
new file mode 100644
index 00000000000000..030ced272fcab6
--- /dev/null
+++ b/test/integration/fixtures/blocks/core__table__deprecated-4.parsed.json
@@ -0,0 +1,11 @@
+[
+ {
+ "blockName": "core/table",
+ "attrs": {},
+ "innerBlocks": [],
+ "innerHTML": "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing \n",
+ "innerContent": [
+ "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing \n"
+ ]
+ }
+]
diff --git a/test/integration/fixtures/blocks/core__table__deprecated-4.serialized.html b/test/integration/fixtures/blocks/core__table__deprecated-4.serialized.html
new file mode 100644
index 00000000000000..3f2f2b362e378c
--- /dev/null
+++ b/test/integration/fixtures/blocks/core__table__deprecated-4.serialized.html
@@ -0,0 +1,3 @@
+
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
A table for testing
+
diff --git a/test/integration/fixtures/blocks/core__table__scope-attribute.html b/test/integration/fixtures/blocks/core__table__scope-attribute.html
index dfe5cdd5c26168..65f558aa5c08a1 100644
--- a/test/integration/fixtures/blocks/core__table__scope-attribute.html
+++ b/test/integration/fixtures/blocks/core__table__scope-attribute.html
@@ -1,3 +1,3 @@
-Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
diff --git a/test/integration/fixtures/blocks/core__table__scope-attribute.json b/test/integration/fixtures/blocks/core__table__scope-attribute.json
index 0b6f1634893813..5cdf1d0ddd2fcb 100644
--- a/test/integration/fixtures/blocks/core__table__scope-attribute.json
+++ b/test/integration/fixtures/blocks/core__table__scope-attribute.json
@@ -3,7 +3,7 @@
"name": "core/table",
"isValid": true,
"attributes": {
- "hasFixedLayout": false,
+ "hasFixedLayout": true,
"caption": "",
"head": [
{
diff --git a/test/integration/fixtures/blocks/core__table__scope-attribute.parsed.json b/test/integration/fixtures/blocks/core__table__scope-attribute.parsed.json
index 42844cfdf62c6f..ec184dfefdf966 100644
--- a/test/integration/fixtures/blocks/core__table__scope-attribute.parsed.json
+++ b/test/integration/fixtures/blocks/core__table__scope-attribute.parsed.json
@@ -3,9 +3,9 @@
"blockName": "core/table",
"attrs": {},
"innerBlocks": [],
- "innerHTML": "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n",
+ "innerHTML": "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n",
"innerContent": [
- "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n"
+ "\nVersion Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
\n"
]
}
]
diff --git a/test/integration/fixtures/blocks/core__table__scope-attribute.serialized.html b/test/integration/fixtures/blocks/core__table__scope-attribute.serialized.html
index dfe5cdd5c26168..65f558aa5c08a1 100644
--- a/test/integration/fixtures/blocks/core__table__scope-attribute.serialized.html
+++ b/test/integration/fixtures/blocks/core__table__scope-attribute.serialized.html
@@ -1,3 +1,3 @@
-Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
+Version Musician Date .70 No musician chosen. May 27, 2003 1.0 Miles Davis January 3, 2004 Lots of versions skipped, see the full list … … 4.4 Clifford Brown December 8, 2015 4.5 Coleman Hawkins April 12, 2016 4.6 Pepper Adams August 16, 2016 4.7 Sarah Vaughan December 6, 2016
diff --git a/test/integration/fixtures/documents/apple-out.html b/test/integration/fixtures/documents/apple-out.html
index d873c942ea9ce1..afada0ee3136e8 100644
--- a/test/integration/fixtures/documents/apple-out.html
+++ b/test/integration/fixtures/documents/apple-out.html
@@ -43,7 +43,7 @@
-
+
diff --git a/test/integration/fixtures/documents/evernote-out.html b/test/integration/fixtures/documents/evernote-out.html
index 19102ab70dc487..a5ff509c7a1737 100644
--- a/test/integration/fixtures/documents/evernote-out.html
+++ b/test/integration/fixtures/documents/evernote-out.html
@@ -47,7 +47,7 @@
-
+
diff --git a/test/integration/fixtures/documents/google-docs-out.html b/test/integration/fixtures/documents/google-docs-out.html
index e88311fab7b1f6..f2ec15cf4f92ad 100644
--- a/test/integration/fixtures/documents/google-docs-out.html
+++ b/test/integration/fixtures/documents/google-docs-out.html
@@ -43,7 +43,7 @@
This is a heading
-
+
diff --git a/test/integration/fixtures/documents/google-docs-table-out.html b/test/integration/fixtures/documents/google-docs-table-out.html
index 07fe4106f3a6a7..da51f75f3644e0 100644
--- a/test/integration/fixtures/documents/google-docs-table-out.html
+++ b/test/integration/fixtures/documents/google-docs-table-out.html
@@ -1,3 +1,3 @@
-
+
diff --git a/test/integration/fixtures/documents/google-docs-table-with-colspan-out.html b/test/integration/fixtures/documents/google-docs-table-with-colspan-out.html
index 3c397c142e34dd..f063d499b0179c 100644
--- a/test/integration/fixtures/documents/google-docs-table-with-colspan-out.html
+++ b/test/integration/fixtures/documents/google-docs-table-with-colspan-out.html
@@ -1,3 +1,3 @@
-
+
diff --git a/test/integration/fixtures/documents/google-docs-table-with-comments-out.html b/test/integration/fixtures/documents/google-docs-table-with-comments-out.html
index 07fe4106f3a6a7..da51f75f3644e0 100644
--- a/test/integration/fixtures/documents/google-docs-table-with-comments-out.html
+++ b/test/integration/fixtures/documents/google-docs-table-with-comments-out.html
@@ -1,3 +1,3 @@
-
+
diff --git a/test/integration/fixtures/documents/google-docs-table-with-rowspan-out.html b/test/integration/fixtures/documents/google-docs-table-with-rowspan-out.html
index d451d6eb2988be..94e0124e280e08 100644
--- a/test/integration/fixtures/documents/google-docs-table-with-rowspan-out.html
+++ b/test/integration/fixtures/documents/google-docs-table-with-rowspan-out.html
@@ -1,3 +1,3 @@
-
+
diff --git a/test/integration/fixtures/documents/google-docs-with-comments-out.html b/test/integration/fixtures/documents/google-docs-with-comments-out.html
index e88311fab7b1f6..f2ec15cf4f92ad 100644
--- a/test/integration/fixtures/documents/google-docs-with-comments-out.html
+++ b/test/integration/fixtures/documents/google-docs-with-comments-out.html
@@ -43,7 +43,7 @@ This is a heading
-
+
diff --git a/test/integration/fixtures/documents/markdown-out.html b/test/integration/fixtures/documents/markdown-out.html
index 31fa8dacbebf0a..ed57e4e05e7176 100644
--- a/test/integration/fixtures/documents/markdown-out.html
+++ b/test/integration/fixtures/documents/markdown-out.html
@@ -51,11 +51,11 @@ Table
-First Header Second Header Content from cell 1 Content from cell 2 Content in the first column Content in the second column
+First Header Second Header Content from cell 1 Content from cell 2 Content in the first column Content in the second column
-
+
diff --git a/test/integration/fixtures/documents/ms-word-online-out.html b/test/integration/fixtures/documents/ms-word-online-out.html
index 8187b598f9a91a..2d8314bbf0fd60 100644
--- a/test/integration/fixtures/documents/ms-word-online-out.html
+++ b/test/integration/fixtures/documents/ms-word-online-out.html
@@ -39,7 +39,7 @@
-One Two Three 1 2 3 I II III
+One Two Three 1 2 3 I II III
diff --git a/test/integration/fixtures/documents/ms-word-out.html b/test/integration/fixtures/documents/ms-word-out.html
index 98992494032b3e..89eaa6f3bcd161 100644
--- a/test/integration/fixtures/documents/ms-word-out.html
+++ b/test/integration/fixtures/documents/ms-word-out.html
@@ -51,7 +51,7 @@ This is a heading level 2
-
+