diff --git a/docs/reference/deprecated.md b/docs/reference/deprecated.md index deef0e0d7fbef..d13652597953d 100644 --- a/docs/reference/deprecated.md +++ b/docs/reference/deprecated.md @@ -1,16 +1,5 @@ Gutenberg's deprecation policy is intended to support backwards-compatibility for two minor releases, when possible. The current deprecations are listed below and are grouped by _the version at which they will be removed completely_. If your plugin depends on these behaviors, you must update to the recommended alternative before the noted version. -## 4.4.0 - -- The block attribute sources `children` and `node` have been removed. Please use the `rich-text` source instead. See the core blocks for examples. -- `wp.blocks.node.matcher` has been removed. Please use `wp.richTextValue.create` instead. -- `wp.blocks.node.toHTML` has been removed. Please use `wp.richTextValue.toHTMLString` instead. -- `wp.blocks.node.fromDOM` has been removed. Please use `wp.richTextValue.create` instead. -- `wp.blocks.children.toHTML` has been removed. Please use `wp.richTextValue.toHTMLString` instead. -- `wp.blocks.children.fromDOM` has been removed. Please use `wp.richTextValue.create` instead. -- `wp.blocks.children.concat` has been removed. Please use `wp.richTextValue.concat` instead. -- `wp.blocks.children.getChildrenArray` has been removed. Please use `wp.richTextValue.create` instead. - ## 4.2.0 - Writing resolvers as async generators has been removed. Use the controls plugin instead. diff --git a/lib/client-assets.php b/lib/client-assets.php index 71678b5de04db..1c0f1059ea9a1 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -423,7 +423,6 @@ function gutenberg_register_scripts_and_styles() { 'wp-polyfill', 'wp-shortcode', 'lodash', - 'wp-rich-text', ), filemtime( gutenberg_dir_path() . 'build/blocks/index.js' ), true diff --git a/packages/block-library/src/audio/index.js b/packages/block-library/src/audio/index.js index 3df0228df9f9e..948a25f55596c 100644 --- a/packages/block-library/src/audio/index.js +++ b/packages/block-library/src/audio/index.js @@ -30,7 +30,7 @@ export const settings = { attribute: 'src', }, caption: { - source: 'rich-text', + source: 'html', selector: 'figcaption', }, id: { diff --git a/packages/block-library/src/button/index.js b/packages/block-library/src/button/index.js index 6794b9b765c67..5f41823636930 100644 --- a/packages/block-library/src/button/index.js +++ b/packages/block-library/src/button/index.js @@ -32,7 +32,7 @@ const blockAttributes = { attribute: 'title', }, text: { - source: 'rich-text', + source: 'html', selector: 'a', }, backgroundColor: { diff --git a/packages/block-library/src/cover-image/index.js b/packages/block-library/src/cover-image/index.js index 6f745f7c78808..82e3ebdac1ae0 100644 --- a/packages/block-library/src/cover-image/index.js +++ b/packages/block-library/src/cover-image/index.js @@ -28,7 +28,7 @@ const validAlignments = [ 'left', 'center', 'right', 'wide', 'full' ]; const blockAttributes = { title: { - source: 'rich-text', + source: 'html', selector: 'p', }, url: { @@ -310,7 +310,7 @@ export const settings = { attributes: { ...blockAttributes, title: { - source: 'rich-text', + source: 'html', selector: 'h2', }, }, diff --git a/packages/block-library/src/embed/index.js b/packages/block-library/src/embed/index.js index 32efcbaaa281f..363a26707fa36 100644 --- a/packages/block-library/src/embed/index.js +++ b/packages/block-library/src/embed/index.js @@ -371,7 +371,7 @@ const embedAttributes = { type: 'string', }, caption: { - source: 'rich-text', + source: 'html', selector: 'figcaption', }, type: { diff --git a/packages/block-library/src/file/index.js b/packages/block-library/src/file/index.js index 78f4173520899..3b8ae9f78359b 100644 --- a/packages/block-library/src/file/index.js +++ b/packages/block-library/src/file/index.js @@ -11,7 +11,7 @@ import { createBlobURL } from '@wordpress/blob'; import { createBlock } from '@wordpress/blocks'; import { select } from '@wordpress/data'; import { RichText } from '@wordpress/editor'; -import { getTextContent, isEmpty } from '@wordpress/rich-text'; +import { create, getTextContent } from '@wordpress/rich-text'; /** * Internal dependencies @@ -39,7 +39,7 @@ export const settings = { type: 'string', }, fileName: { - source: 'rich-text', + source: 'html', selector: 'a:not([download])', }, // Differs to the href when the block is configured to link to the attachment page @@ -61,7 +61,7 @@ export const settings = { default: true, }, downloadButtonText: { - source: 'rich-text', + source: 'html', selector: 'a[download]', default: __( 'Download' ), }, @@ -203,7 +203,7 @@ export const settings = { return ( href &&
+ />'; const match = parse( html, sources.children() ); - expect( console ).toHaveWarned(); expect( renderToString( match ) ).toBe( html ); } ); } ); @@ -37,7 +35,6 @@ describe( 'matchers', () => { it( 'should return a source function', () => { const source = sources.node(); - expect( console ).toHaveWarned(); expect( typeof source ).toBe( 'function' ); } ); diff --git a/packages/blocks/src/api/test/node.js b/packages/blocks/src/api/test/node.js index 6f78a5f96c518..447395a24ed12 100644 --- a/packages/blocks/src/api/test/node.js +++ b/packages/blocks/src/api/test/node.js @@ -31,7 +31,6 @@ describe( 'toHTML', () => { const html = toHTML( blockNode ); - expect( console ).toHaveWarned(); expect( html ).toBe( 'This is a test' ); } ); } ); @@ -42,7 +41,6 @@ describe( 'fromDOM', () => { const blockNode = fromDOM( node ); - expect( console ).toHaveWarned(); expect( blockNode ).toBe( 'Hello world' ); } ); @@ -59,7 +57,6 @@ describe( 'fromDOM', () => { const blockNode = fromDOM( node ); - expect( console ).toHaveWarned(); expect( blockNode ).toEqual( { type: 'strong', props: { diff --git a/packages/editor/src/components/block-list/test/block-html.js b/packages/editor/src/components/block-list/test/block-html.js index 7410aa74ba933..442e55de3f5bb 100644 --- a/packages/editor/src/components/block-list/test/block-html.js +++ b/packages/editor/src/components/block-list/test/block-html.js @@ -8,7 +8,6 @@ import { shallow } from 'enzyme'; */ import { createBlock } from '@wordpress/blocks'; import { registerCoreBlocks } from '@wordpress/block-library'; -import { create } from '@wordpress/rich-text'; /** * Internal dependencies @@ -35,7 +34,7 @@ describe( 'BlockHTML', () => { it( 'use block content for a valid block', () => { const block = createBlock( 'core/paragraph', { - content: create( { text: 'test-block' } ), + content: 'test-block', isValid: true, } ); diff --git a/packages/editor/src/components/document-outline/test/__snapshots__/index.js.snap b/packages/editor/src/components/document-outline/test/__snapshots__/index.js.snap index 7f799c687d240..a038d12930951 100644 --- a/packages/editor/src/components/document-outline/test/__snapshots__/index.js.snap +++ b/packages/editor/src/components/document-outline/test/__snapshots__/index.js.snap @@ -13,29 +13,9 @@ exports[`DocumentOutline header blocks present should match snapshot 1`] = ` path={Array []} >A delicious sundae dessert
One | Two | Three |
1 | 2 | 3 |
I | II | III |
+One + | +Two + | +Three + |
+1 + | +2 + | +3 + |
+I + | +II + | +III + |
This is a paragraph.
This is a link.
This is a paragraph.
+
This is a link.
+
One | Two | Three |
Four | Five | Six |
One + | Two + | Three + |
Four + | Five + | Six + |
Preserve
line breaks please.
Preserve
+line breaks please.
This is a heading
+This is a heading
-This is a paragraph with a link.
+This is a paragraph with a link.
-One | Two | Three |
1 | 2 | 3 |
I | II | III |
One | Two | Three |
1 | 2 | 3 |
I | II | III |
An image:
+An image:
diff --git a/test/integration/fixtures/ms-word-out.html b/test/integration/fixtures/ms-word-out.html index edf7209a4f8f3..c53c5aaeba2e9 100644 --- a/test/integration/fixtures/ms-word-out.html +++ b/test/integration/fixtures/ms-word-out.html @@ -1,9 +1,11 @@ -This is atitle
+This is a +title
-This is asubtitle
+This is a +subtitle
@@ -27,7 +29,25 @@One | Two | Three |
1 | 2 | 3 |
I | II | III |
+ One + | + Two + | + Three + |
+ 1 + | + 2 + | + 3 + |
+ I + | + II + | + III + |
Loremipsum dolor sit amet, consectetur adipiscing elit
++Lorem +ipsum dolor sit amet, consectetur adipiscing elit +
-Loremipsum dolor sit amet, consectetur adipiscing elit. Pellentesquealiquet hendrerit auctor. Nam lobortis, est vel lacinia tincidunt,purus tellus vehicula ex, nec pharetra justo dui sed lorem. Namcongue laoreet massa, quis varius est tincidunt ut.
++Lorem +ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque +aliquet hendrerit auctor. Nam lobortis, est vel lacinia tincidunt, +purus tellus vehicula ex, nec pharetra justo dui sed lorem. Nam +congue laoreet massa, quis varius est tincidunt ut.
diff --git a/test/integration/full-content/fixtures/core__audio.json b/test/integration/full-content/fixtures/core__audio.json index 879f5f8371c9a..f9acbfdd8ce2d 100644 --- a/test/integration/full-content/fixtures/core__audio.json +++ b/test/integration/full-content/fixtures/core__audio.json @@ -5,10 +5,7 @@ "isValid": true, "attributes": { "src": "https://media.simplecast.com/episodes/audio/80564/draft-podcast-51-livePublish2.mp3", - "caption": { - "formats": [], - "text": "" - }, + "caption": "", "autoplay": false, "loop": false, "align": "right" diff --git a/test/integration/full-content/fixtures/core__button__center.json b/test/integration/full-content/fixtures/core__button__center.json index 4ccdc68fc2090..7334b3f483293 100644 --- a/test/integration/full-content/fixtures/core__button__center.json +++ b/test/integration/full-content/fixtures/core__button__center.json @@ -5,31 +5,7 @@ "isValid": true, "attributes": { "url": "https://github.com/WordPress/gutenberg", - "text": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Help build Gutenberg" - }, + "text": "Help build Gutenberg", "align": "center" }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__column.json b/test/integration/full-content/fixtures/core__column.json index 358a0d4e94a75..aabfc10300c5e 100644 --- a/test/integration/full-content/fixtures/core__column.json +++ b/test/integration/full-content/fixtures/core__column.json @@ -10,36 +10,7 @@ "name": "core/paragraph", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Column One, Paragraph One" - }, + "content": "Column One, Paragraph One", "dropCap": false }, "innerBlocks": [], @@ -50,36 +21,7 @@ "name": "core/paragraph", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Column One, Paragraph Two" - }, + "content": "Column One, Paragraph Two", "dropCap": false }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__columns.json b/test/integration/full-content/fixtures/core__columns.json index bbadafd319fb8..2a446b72dc79d 100644 --- a/test/integration/full-content/fixtures/core__columns.json +++ b/test/integration/full-content/fixtures/core__columns.json @@ -18,36 +18,7 @@ "name": "core/paragraph", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Column One, Paragraph One" - }, + "content": "Column One, Paragraph One", "dropCap": false }, "innerBlocks": [], @@ -58,36 +29,7 @@ "name": "core/paragraph", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Column One, Paragraph Two" - }, + "content": "Column One, Paragraph Two", "dropCap": false }, "innerBlocks": [], @@ -107,36 +49,7 @@ "name": "core/paragraph", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Column Two, Paragraph One" - }, + "content": "Column Two, Paragraph One", "dropCap": false }, "innerBlocks": [], @@ -147,38 +60,7 @@ "name": "core/paragraph", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Column Three, Paragraph One" - }, + "content": "Column Three, Paragraph One", "dropCap": false }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__cover-image.json b/test/integration/full-content/fixtures/core__cover-image.json index 1dfe4234cc147..342a160d3e4de 100644 --- a/test/integration/full-content/fixtures/core__cover-image.json +++ b/test/integration/full-content/fixtures/core__cover-image.json @@ -4,22 +4,7 @@ "name": "core/cover-image", "isValid": true, "attributes": { - "title": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Guten Berg!" - }, + "title": "Guten Berg!", "url": "https://cldup.com/uuUqE_dXzy.jpg", "contentAlign": "center", "hasParallax": false, diff --git a/test/integration/full-content/fixtures/core__embed.json b/test/integration/full-content/fixtures/core__embed.json index 11575f599e331..916935db4c4c3 100644 --- a/test/integration/full-content/fixtures/core__embed.json +++ b/test/integration/full-content/fixtures/core__embed.json @@ -5,47 +5,7 @@ "isValid": true, "attributes": { "url": "https://example.com/", - "caption": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Embedded content from an example URL" - }, + "caption": "Embedded content from an example URL", "allowResponsive": true }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__file__new-window.json b/test/integration/full-content/fixtures/core__file__new-window.json index 8882cfdaf9d7b..4922f02880ecc 100644 --- a/test/integration/full-content/fixtures/core__file__new-window.json +++ b/test/integration/full-content/fixtures/core__file__new-window.json @@ -6,31 +6,11 @@ "attributes": { "id": 176, "href": "http://localhost:8888/wp-content/uploads/2018/05/keycodes.js", - "fileName": { - "formats": [ - null, - null, - null, - null - ], - "text": "6546" - }, + "fileName": "6546", "textLinkHref": "http://localhost:8888/wp-content/uploads/2018/05/keycodes.js", "textLinkTarget": "_blank", "showDownloadButton": true, - "downloadButtonText": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Download" - } + "downloadButtonText": "Download" }, "innerBlocks": [], "originalContent": "" diff --git a/test/integration/full-content/fixtures/core__file__no-download-button.json b/test/integration/full-content/fixtures/core__file__no-download-button.json index f2ba1e521615e..44ff5553acbe1 100644 --- a/test/integration/full-content/fixtures/core__file__no-download-button.json +++ b/test/integration/full-content/fixtures/core__file__no-download-button.json @@ -6,26 +6,10 @@ "attributes": { "id": 176, "href": "http://localhost:8888/wp-content/uploads/2018/05/keycodes.js", - "fileName": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "lkjfijwef" - }, + "fileName": "lkjfijwef", "textLinkHref": "http://localhost:8888/?attachment_id=176", "showDownloadButton": false, - "downloadButtonText": { - "formats": [], - "text": "" - } + "downloadButtonText": "" }, "innerBlocks": [], "originalContent": "" diff --git a/test/integration/full-content/fixtures/core__file__no-text-link.json b/test/integration/full-content/fixtures/core__file__no-text-link.json index 6a3ac7afc6078..6cf32d1f9d959 100644 --- a/test/integration/full-content/fixtures/core__file__no-text-link.json +++ b/test/integration/full-content/fixtures/core__file__no-text-link.json @@ -6,24 +6,9 @@ "attributes": { "id": 176, "href": "http://localhost:8888/wp-content/uploads/2018/05/keycodes.js", - "fileName": { - "formats": [], - "text": "" - }, + "fileName": "", "showDownloadButton": true, - "downloadButtonText": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Download" - } + "downloadButtonText": "Download" }, "innerBlocks": [], "originalContent": "" diff --git a/test/integration/full-content/fixtures/core__gallery.json b/test/integration/full-content/fixtures/core__gallery.json index 2dcebc80a03af..8cfcc26d3b37a 100644 --- a/test/integration/full-content/fixtures/core__gallery.json +++ b/test/integration/full-content/fixtures/core__gallery.json @@ -8,18 +8,12 @@ { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "title", - "caption": { - "formats": [], - "text": "" - } + "caption": "" }, { "url": "http://google.com/hi.png", "alt": "title", - "caption": { - "formats": [], - "text": "" - } + "caption": "" } ], "imageCrop": true, diff --git a/test/integration/full-content/fixtures/core__gallery__columns.json b/test/integration/full-content/fixtures/core__gallery__columns.json index a9d27c457cb01..b3daaa05f6e8a 100644 --- a/test/integration/full-content/fixtures/core__gallery__columns.json +++ b/test/integration/full-content/fixtures/core__gallery__columns.json @@ -8,18 +8,12 @@ { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "title", - "caption": { - "formats": [], - "text": "" - } + "caption": "" }, { "url": "http://google.com/hi.png", "alt": "title", - "caption": { - "formats": [], - "text": "" - } + "caption": "" } ], "columns": 1, diff --git a/test/integration/full-content/fixtures/core__heading__h2-em.json b/test/integration/full-content/fixtures/core__heading__h2-em.json index 786643107f39e..b72785dd6d8c2 100644 --- a/test/integration/full-content/fixtures/core__heading__h2-em.json +++ b/test/integration/full-content/fixtures/core__heading__h2-em.json @@ -4,60 +4,7 @@ "name": "core/heading", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - null, - null, - null, - null, - null - ], - "text": "The Inserter Tool" - }, + "content": "The Inserter Tool", "level": 2 }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__heading__h2.json b/test/integration/full-content/fixtures/core__heading__h2.json index 388f98214362d..f2073ff78bd43 100644 --- a/test/integration/full-content/fixtures/core__heading__h2.json +++ b/test/integration/full-content/fixtures/core__heading__h2.json @@ -4,69 +4,7 @@ "name": "core/heading", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "A picture is worth a thousand words, or so the saying goes" - }, + "content": "A picture is worth a thousand words, or so the saying goes", "level": 2 }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__image.json b/test/integration/full-content/fixtures/core__image.json index dd89c78069c8e..4369150f0c929 100644 --- a/test/integration/full-content/fixtures/core__image.json +++ b/test/integration/full-content/fixtures/core__image.json @@ -6,10 +6,7 @@ "attributes": { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "", - "caption": { - "formats": [], - "text": "" - }, + "caption": "", "linkDestination": "none" }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__image__attachment-link.json b/test/integration/full-content/fixtures/core__image__attachment-link.json index 3aaa94408659a..5d169589043a5 100644 --- a/test/integration/full-content/fixtures/core__image__attachment-link.json +++ b/test/integration/full-content/fixtures/core__image__attachment-link.json @@ -6,10 +6,7 @@ "attributes": { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "", - "caption": { - "formats": [], - "text": "" - }, + "caption": "", "href": "http://localhost:8888/?attachment_id=7", "linkDestination": "attachment" }, diff --git a/test/integration/full-content/fixtures/core__image__center-caption.json b/test/integration/full-content/fixtures/core__image__center-caption.json index 571e6ad5a676f..f569bda22c81b 100644 --- a/test/integration/full-content/fixtures/core__image__center-caption.json +++ b/test/integration/full-content/fixtures/core__image__center-caption.json @@ -6,78 +6,7 @@ "attributes": { "url": "https://cldup.com/YLYhpou2oq.jpg", "alt": "", - "caption": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Give it a try. Press the \"really wide\" button on the image toolbar." - }, + "caption": "Give it a try. Press the \"really wide\" button on the image toolbar.", "align": "center", "linkDestination": "none" }, diff --git a/test/integration/full-content/fixtures/core__image__custom-link.json b/test/integration/full-content/fixtures/core__image__custom-link.json index 136ae7357e680..735e552282662 100644 --- a/test/integration/full-content/fixtures/core__image__custom-link.json +++ b/test/integration/full-content/fixtures/core__image__custom-link.json @@ -6,10 +6,7 @@ "attributes": { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "", - "caption": { - "formats": [], - "text": "" - }, + "caption": "", "href": "https://wordpress.org/", "linkDestination": "custom" }, diff --git a/test/integration/full-content/fixtures/core__image__media-link.json b/test/integration/full-content/fixtures/core__image__media-link.json index 6b329e94a4837..690fa778b6fd5 100644 --- a/test/integration/full-content/fixtures/core__image__media-link.json +++ b/test/integration/full-content/fixtures/core__image__media-link.json @@ -6,10 +6,7 @@ "attributes": { "url": "https://cldup.com/uuUqE_dXzy.jpg", "alt": "", - "caption": { - "formats": [], - "text": "" - }, + "caption": "", "href": "https://cldup.com/uuUqE_dXzy.jpg", "linkDestination": "media" }, diff --git a/test/integration/full-content/fixtures/core__list__ul.json b/test/integration/full-content/fixtures/core__list__ul.json index 56fecc822876c..17baec7cef1c7 100644 --- a/test/integration/full-content/fixtures/core__list__ul.json +++ b/test/integration/full-content/fixtures/core__list__ul.json @@ -5,224 +5,7 @@ "isValid": true, "attributes": { "ordered": false, - "values": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Text & Headings Images & Videos Galleries Embeds, like YouTube, Tweets, or other WordPress posts. Layout blocks, like Buttons, Hero Images, Separators, etc. And Lists like this one of course :)" - } + "values": "Some preformatted text..." diff --git a/test/integration/full-content/fixtures/core__pullquote.json b/test/integration/full-content/fixtures/core__pullquote.json index 89cbf3529f896..5cf126489bc64 100644 --- a/test/integration/full-content/fixtures/core__pullquote.json +++ b/test/integration/full-content/fixtures/core__pullquote.json @@ -4,59 +4,8 @@ "name": "core/pullquote", "isValid": true, "attributes": { - "value": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Testing pullquote block..." - }, - "citation": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "...with a caption" - } + "value": "
And more!
Testing pullquote block...
", + "citation": "...with a caption" }, "innerBlocks": [], "originalContent": "" diff --git a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.json b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.json index d2f54ac170e1b..81c058e5ab10c 100644 --- a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.json +++ b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.json @@ -4,66 +4,8 @@ "name": "core/pullquote", "isValid": true, "attributes": { - "value": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - [ - { - "type": "strong" - } - ], - [ - { - "type": "strong" - } - ], - [ - { - "type": "strong" - } - ], - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Paragraph one Paragraph two" - }, - "citation": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "by whomever" - } + "value": "Paragraph one
Paragraph two
", + "citation": "by whomever" }, "innerBlocks": [], "originalContent": "" diff --git a/test/integration/full-content/fixtures/core__quote__style-1.json b/test/integration/full-content/fixtures/core__quote__style-1.json index cddef91c40054..cd8d15bcc9b34 100644 --- a/test/integration/full-content/fixtures/core__quote__style-1.json +++ b/test/integration/full-content/fixtures/core__quote__style-1.json @@ -4,268 +4,8 @@ "name": "core/quote", "isValid": true, "attributes": { - "value": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery." - }, - "citation": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Matt Mullenweg, 2017" - } + "value": "The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.
", + "citation": "Matt Mullenweg, 2017" }, "innerBlocks": [], "originalContent": "" diff --git a/test/integration/full-content/fixtures/core__quote__style-2.json b/test/integration/full-content/fixtures/core__quote__style-2.json index 29ed76be417ea..300770c72c007 100644 --- a/test/integration/full-content/fixtures/core__quote__style-2.json +++ b/test/integration/full-content/fixtures/core__quote__style-2.json @@ -4,94 +4,8 @@ "name": "core/quote", "isValid": true, "attributes": { - "value": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "There is no greater agony than bearing an untold story inside you." - }, - "citation": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Maya Angelou" - }, + "value": "The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.
Matt Mullenweg, 2017
There is no greater agony than bearing an untold story inside you.
", + "citation": "Maya Angelou", "className": "is-style-large" }, "innerBlocks": [], diff --git a/test/integration/full-content/fixtures/core__subhead.json b/test/integration/full-content/fixtures/core__subhead.json index 291374ad1a6c1..a0c58740e2bc6 100644 --- a/test/integration/full-content/fixtures/core__subhead.json +++ b/test/integration/full-content/fixtures/core__subhead.json @@ -4,57 +4,7 @@ "name": "core/subhead", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - [ - { - "type": "em" - } - ], - null - ], - "text": "This is a subhead." - } + "content": "This is a subhead." }, "innerBlocks": [], "originalContent": "This is a subhead.
" diff --git a/test/integration/full-content/fixtures/core__table.json b/test/integration/full-content/fixtures/core__table.json index bdd286d4eaa09..7d71d09c53be8 100644 --- a/test/integration/full-content/fixtures/core__table.json +++ b/test/integration/full-content/fixtures/core__table.json @@ -9,46 +9,15 @@ { "cells": [ { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null - ], - "text": "Version" - }, + "content": "Version", "tag": "th" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Musician" - }, + "content": "Musician", "tag": "th" }, { - "content": { - "formats": [ - null, - null, - null, - null - ], - "text": "Date" - }, + "content": "Date", "tag": "th" } ] @@ -58,82 +27,15 @@ { "cells": [ { - "content": { - "formats": [ - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2003/05/wordpress-now-available/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2003/05/wordpress-now-available/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2003/05/wordpress-now-available/" - } - } - ] - ], - "text": ".70" - }, + "content": ".70", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "No musician chosen." - }, + "content": "No musician chosen.", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "May 27, 2003" - }, + "content": "May 27, 2003", "tag": "td" } ] @@ -141,77 +43,15 @@ { "cells": [ { - "content": { - "formats": [ - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2004/01/wordpress-10/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2004/01/wordpress-10/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2004/01/wordpress-10/" - } - } - ] - ], - "text": "1.0" - }, + "content": "1.0", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Miles Davis" - }, + "content": "Miles Davis", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "January 3, 2004" - }, + "content": "January 3, 2004", "tag": "td" } ] @@ -219,163 +59,15 @@ { "cells": [ { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://codex.wordpress.org/WordPress_Versions" - } - } - ] - ], - "text": "Lots of versions skipped, see the full list" - }, + "content": "Lots of versions skipped, see the full list", "tag": "td" }, { - "content": { - "formats": [ - null - ], - "text": "…" - }, + "content": "…", "tag": "td" }, { - "content": { - "formats": [ - null - ], - "text": "…" - }, + "content": "…", "tag": "td" } ] @@ -383,81 +75,15 @@ { "cells": [ { - "content": { - "formats": [ - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2015/12/clifford/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2015/12/clifford/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2015/12/clifford/" - } - } - ] - ], - "text": "4.4" - }, + "content": "4.4", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Clifford Brown" - }, + "content": "Clifford Brown", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "December 8, 2015" - }, + "content": "December 8, 2015", "tag": "td" } ] @@ -465,80 +91,15 @@ { "cells": [ { - "content": { - "formats": [ - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/04/coleman/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/04/coleman/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/04/coleman/" - } - } - ] - ], - "text": "4.5" - }, + "content": "4.5", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Coleman Hawkins" - }, + "content": "Coleman Hawkins", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "April 12, 2016" - }, + "content": "April 12, 2016", "tag": "td" } ] @@ -546,78 +107,15 @@ { "cells": [ { - "content": { - "formats": [ - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/08/pepper/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/08/pepper/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/08/pepper/" - } - } - ] - ], - "text": "4.6" - }, + "content": "4.6", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Pepper Adams" - }, + "content": "Pepper Adams", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "August 16, 2016" - }, + "content": "August 16, 2016", "tag": "td" } ] @@ -625,80 +123,15 @@ { "cells": [ { - "content": { - "formats": [ - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/12/vaughan/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/12/vaughan/" - } - } - ], - [ - { - "type": "a", - "attributes": { - "href": "https://wordpress.org/news/2016/12/vaughan/" - } - } - ] - ], - "text": "4.7" - }, + "content": "4.7", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "Sarah Vaughan" - }, + "content": "Sarah Vaughan", "tag": "td" }, { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "December 6, 2016" - }, + "content": "December 6, 2016", "tag": "td" } ] diff --git a/test/integration/full-content/fixtures/core__text-columns.json b/test/integration/full-content/fixtures/core__text-columns.json index 2a31ae6ff865f..f610db9e556a7 100644 --- a/test/integration/full-content/fixtures/core__text-columns.json +++ b/test/integration/full-content/fixtures/core__text-columns.json @@ -6,24 +6,10 @@ "attributes": { "content": [ { - "children": { - "formats": [ - null, - null, - null - ], - "text": "One" - } + "children": "One" }, { - "children": { - "formats": [ - null, - null, - null - ], - "text": "Two" - } + "children": "Two" } ], "columns": 2, diff --git a/test/integration/full-content/fixtures/core__text__converts-to-paragraph.json b/test/integration/full-content/fixtures/core__text__converts-to-paragraph.json index 951cc3900f3c1..2f85e75d9af26 100644 --- a/test/integration/full-content/fixtures/core__text__converts-to-paragraph.json +++ b/test/integration/full-content/fixtures/core__text__converts-to-paragraph.json @@ -4,111 +4,7 @@ "name": "core/paragraph", "isValid": true, "attributes": { - "content": { - "formats": [ - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - [ - { - "type": "code" - } - ], - null, - null, - null, - null, - null, - null, - null, - null, - null, - null - ], - "text": "This is an old-style text block. Changed to paragraph in #2135." - }, + "content": "This is an old-style text block. Changed toparagraph
in #2135.",
"dropCap": false
},
"innerBlocks": [],
diff --git a/test/integration/full-content/fixtures/core__verse.json b/test/integration/full-content/fixtures/core__verse.json
index e7d92ea856bff..5c6e3d83e6516 100644
--- a/test/integration/full-content/fixtures/core__verse.json
+++ b/test/integration/full-content/fixtures/core__verse.json
@@ -4,49 +4,7 @@
"name": "core/verse",
"isValid": true,
"attributes": {
- "content": {
- "formats": [
- null,
- null,
- [
- {
- "type": "em"
- }
- ],
- [
- {
- "type": "em"
- }
- ],
- [
- {
- "type": "em"
- }
- ],
- [
- {
- "type": "em"
- }
- ],
- [
- {
- "type": "em"
- }
- ],
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null
- ],
- "text": "A verse…\nAnd more!"
- }
+ "content": "A verse…A verse…" diff --git a/test/integration/full-content/fixtures/core__video.json b/test/integration/full-content/fixtures/core__video.json index b0a67a574890a..e91fd20c5bd8b 100644 --- a/test/integration/full-content/fixtures/core__video.json +++ b/test/integration/full-content/fixtures/core__video.json @@ -5,10 +5,7 @@ "isValid": true, "attributes": { "autoplay": false, - "caption": { - "formats": [], - "text": "" - }, + "caption": "", "controls": true, "loop": false, "muted": false,
And more!