From df25bf5a04f971b8a75c80db65fa3c0be81487f0 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 23 Nov 2023 09:42:47 +0100 Subject: [PATCH 01/16] Add server-side block class names to the list blocks --- lib/blocks.php | 4 +- .../block-library/src/list-item/index.php | 47 ++++++++++++++++++ packages/block-library/src/list/index.php | 48 +++++++++++++++++++ 3 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 packages/block-library/src/list-item/index.php create mode 100644 packages/block-library/src/list/index.php diff --git a/lib/blocks.php b/lib/blocks.php index 698b5d6873748f..5bdfe757f9d9e9 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -26,8 +26,6 @@ function gutenberg_reregister_core_block_types() { 'form-submit-button', 'group', 'html', - 'list', - 'list-item', 'media-text', 'missing', 'more', @@ -77,6 +75,8 @@ function gutenberg_reregister_core_block_types() { 'heading.php' => 'core/heading', 'latest-comments.php' => 'core/latest-comments', 'latest-posts.php' => 'core/latest-posts', + 'list.php' => 'core/list', + 'list-item.php' => 'core/list-item', 'loginout.php' => 'core/loginout', 'navigation.php' => 'core/navigation', 'navigation-link.php' => 'core/navigation-link', diff --git a/packages/block-library/src/list-item/index.php b/packages/block-library/src/list-item/index.php new file mode 100644 index 00000000000000..82f4cbab6d8fb6 --- /dev/null +++ b/packages/block-library/src/list-item/index.php @@ -0,0 +1,47 @@ + would be transformed to
  • . + * + * @see https://github.com/WordPress/gutenberg/issues/12420 + * + * @param array $attributes Attributes of the block being rendered. + * @param string $content Content of the block being rendered. + * + * @return string The content of the block being rendered. + */ +function block_core_list_item_render( $attributes, $content ) { + if ( ! $content ) { + return $content; + } + + $processor = new WP_HTML_Tag_Processor( $content ); + + while ( $processor->next_tag() ) { + if ( 'LI' === $processor->get_tag() ) { + $processor->add_class( 'wp-block-list-item' ); + break; + } + } + + return $processor->get_updated_html(); +} + +/** + * Registers the `core/list-item` block on server. + */ +function register_block_core_list_item() { + register_block_type_from_metadata( + __DIR__ . '/list-item', + array( + 'render_callback' => 'block_core_list_item_render', + ) + ); +} + +add_action( 'init', 'register_block_core_list_item' ); diff --git a/packages/block-library/src/list/index.php b/packages/block-library/src/list/index.php new file mode 100644 index 00000000000000..5b663fdd557a84 --- /dev/null +++ b/packages/block-library/src/list/index.php @@ -0,0 +1,48 @@ + would be transformed to
      . + * + * @see https://github.com/WordPress/gutenberg/issues/12420 + * + * @param array $attributes Attributes of the block being rendered. + * @param string $content Content of the block being rendered. + * + * @return string The content of the block being rendered. + */ +function block_core_list_render( $attributes, $content ) { + if ( ! $content ) { + return $content; + } + + $processor = new WP_HTML_Tag_Processor( $content ); + + $list_tags = array( 'OL', 'UL' ); + while ( $processor->next_tag() ) { + if ( in_array( $processor->get_tag(), $list_tags, true ) ) { + $processor->add_class( 'wp-block-list' ); + break; + } + } + + return $processor->get_updated_html(); +} + +/** + * Registers the `core/list` block on server. + */ +function register_block_core_list() { + register_block_type_from_metadata( + __DIR__ . '/list', + array( + 'render_callback' => 'block_core_list_render', + ) + ); +} + +add_action( 'init', 'register_block_core_list' ); From 01105c7f9e493a6cfbbadf9b2c4676fe70703268 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 23 Nov 2023 10:02:51 +0100 Subject: [PATCH 02/16] fix CS issues --- packages/block-library/src/list-item/index.php | 3 ++- packages/block-library/src/list/index.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/list-item/index.php b/packages/block-library/src/list-item/index.php index 82f4cbab6d8fb6..b4e0585d241c02 100644 --- a/packages/block-library/src/list-item/index.php +++ b/packages/block-library/src/list-item/index.php @@ -1,13 +1,14 @@ would be transformed to
    1. . - * + * * @see https://github.com/WordPress/gutenberg/issues/12420 * * @param array $attributes Attributes of the block being rendered. diff --git a/packages/block-library/src/list/index.php b/packages/block-library/src/list/index.php index 5b663fdd557a84..931a6e9550e5cd 100644 --- a/packages/block-library/src/list/index.php +++ b/packages/block-library/src/list/index.php @@ -1,13 +1,14 @@ would be transformed to
        . - * + * * @see https://github.com/WordPress/gutenberg/issues/12420 * * @param array $attributes Attributes of the block being rendered. From b870eed372fba91062b7b3e5f7993700623787fc Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Fri, 24 Nov 2023 09:55:27 +0100 Subject: [PATCH 03/16] Deprecate the block version that has the className block support set to false. --- docs/reference-guides/core-blocks.md | 4 +- .../block-library/src/list-item/block.json | 2 +- .../block-library/src/list-item/deprecated.js | 55 ++++++++++++ packages/block-library/src/list-item/index.js | 2 + packages/block-library/src/list/block.json | 2 +- packages/block-library/src/list/deprecated.js | 89 ++++++++++++++++++- post-content.php | 14 +-- .../blocks-raw-handling.test.js.snap | 12 +-- test/integration/blocks-raw-handling.test.js | 24 ++--- .../fixtures/blocks/core__list-item.html | 2 +- .../blocks/core__list-item.parsed.json | 6 +- .../blocks/core__list-item.serialized.html | 2 +- .../blocks/core__list-item_deprecated-v1.html | 3 + .../blocks/core__list-item_deprecated-v1.json | 10 +++ .../core__list-item_deprecated-v1.parsed.json | 11 +++ ...e__list-item_deprecated-v1.serialized.html | 3 + .../core__list__deprecated-v0.serialized.html | 8 +- ...list__deprecated-v1-nested.serialized.html | 24 ++--- .../core__list__deprecated-v1.serialized.html | 14 +-- .../core__list__deprecated-v2.parsed.json | 10 ++- .../core__list__deprecated-v2.serialized.html | 4 +- .../fixtures/blocks/core__list__ul.html | 14 +-- .../blocks/core__list__ul.parsed.json | 34 ++++--- .../blocks/core__list__ul.serialized.html | 14 +-- .../fixtures/documents/apple-out.html | 20 ++--- .../fixtures/documents/evernote-out.html | 24 ++--- .../documents/google-docs-list-only-out.html | 14 +-- .../fixtures/documents/google-docs-out.html | 20 ++--- .../google-docs-with-comments-out.html | 20 ++--- .../fixtures/documents/markdown-out.html | 20 ++--- .../fixtures/documents/ms-word-list-out.html | 8 +- .../documents/ms-word-online-out.html | 18 ++-- .../fixtures/documents/ms-word-out.html | 20 ++--- 33 files changed, 356 insertions(+), 171 deletions(-) create mode 100644 packages/block-library/src/list-item/deprecated.js create mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.html create mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.json create mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json create mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 10f0f76d9eb0d7..8e54b26f66ec79 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -405,7 +405,7 @@ Create a bulleted or numbered list. ([Source](https://github.com/WordPress/guten - **Name:** core/list - **Category:** text -- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** __unstablePasteTextInline, anchor, className, color (background, gradients, link, text), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** ordered, placeholder, reversed, start, type, values ## List item @@ -415,7 +415,7 @@ Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/ - **Name:** core/list-item - **Category:** text - **Parent:** core/list -- **Supports:** typography (fontSize, lineHeight), ~~className~~ +- **Supports:** className, typography (fontSize, lineHeight) - **Attributes:** content, placeholder ## Login/out diff --git a/packages/block-library/src/list-item/block.json b/packages/block-library/src/list-item/block.json index 41221f1c31772e..16817e523cb6b6 100644 --- a/packages/block-library/src/list-item/block.json +++ b/packages/block-library/src/list-item/block.json @@ -20,7 +20,7 @@ } }, "supports": { - "className": false, + "className": true, "__experimentalSelector": "li", "typography": { "fontSize": true, diff --git a/packages/block-library/src/list-item/deprecated.js b/packages/block-library/src/list-item/deprecated.js new file mode 100644 index 00000000000000..a748a3693ae887 --- /dev/null +++ b/packages/block-library/src/list-item/deprecated.js @@ -0,0 +1,55 @@ +/** + * WordPress dependencies + */ +import { RichText, InnerBlocks, useBlockProps } from '@wordpress/block-editor'; + +// Version without block support 'className: true'. +const v1 = { + attributes: { + placeholder: { + type: 'string', + }, + content: { + type: 'string', + source: 'html', + selector: 'li', + default: '', + __experimentalRole: 'content', + }, + }, + supports: { + className: false, + __experimentalSelector: 'li', + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true, + }, + }, + }, + save( { attributes } ) { + return ( +
      1. + + +
      2. + ); + }, +}; + +/** + * New deprecations need to be placed first + * for them to have higher priority. + * + * Old deprecations may need to be updated as well. + * + * See block-deprecation.md + */ +export default [ v1 ]; diff --git a/packages/block-library/src/list-item/index.js b/packages/block-library/src/list-item/index.js index 00adc1c2c40266..e593c518680f56 100644 --- a/packages/block-library/src/list-item/index.js +++ b/packages/block-library/src/list-item/index.js @@ -11,6 +11,7 @@ import metadata from './block.json'; import edit from './edit'; import save from './save'; import transforms from './transforms'; +import deprecated from './deprecated'; const { name } = metadata; @@ -27,6 +28,7 @@ export const settings = { }; }, transforms, + deprecated, }; export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/list/block.json b/packages/block-library/src/list/block.json index e2fb9e4c9e3b0d..c2847db5d8c500 100644 --- a/packages/block-library/src/list/block.json +++ b/packages/block-library/src/list/block.json @@ -37,7 +37,7 @@ }, "supports": { "anchor": true, - "className": false, + "className": true, "typography": { "fontSize": true, "lineHeight": true, diff --git a/packages/block-library/src/list/deprecated.js b/packages/block-library/src/list/deprecated.js index cecc17430f65e5..edb04dff27c904 100644 --- a/packages/block-library/src/list/deprecated.js +++ b/packages/block-library/src/list/deprecated.js @@ -219,6 +219,93 @@ const v2 = { migrate: migrateTypeToInlineStyle, }; +// Version without block support 'className: true'. +const v3 = { + attributes: { + ordered: { + type: 'boolean', + default: false, + __experimentalRole: 'content', + }, + values: { + type: 'string', + source: 'html', + selector: 'ol,ul', + multiline: 'li', + __unstableMultilineWrapperTags: [ 'ol', 'ul' ], + default: '', + __experimentalRole: 'content', + }, + type: { + type: 'string', + }, + start: { + type: 'number', + }, + reversed: { + type: 'boolean', + }, + placeholder: { + type: 'string', + }, + }, + supports: { + anchor: true, + className: false, + typography: { + fontSize: true, + lineHeight: true, + __experimentalFontFamily: true, + __experimentalFontWeight: true, + __experimentalFontStyle: true, + __experimentalTextTransform: true, + __experimentalTextDecoration: true, + __experimentalLetterSpacing: true, + __experimentalDefaultControls: { + fontSize: true, + }, + }, + color: { + gradients: true, + link: true, + __experimentalDefaultControls: { + background: true, + text: true, + }, + }, + spacing: { + margin: true, + padding: true, + __experimentalDefaultControls: { + margin: false, + padding: false, + }, + }, + __unstablePasteTextInline: true, + __experimentalSelector: 'ol,ul', + __experimentalOnMerge: 'true', + __experimentalSlashInserter: true, + }, + save( { attributes } ) { + const { ordered, type, reversed, start } = attributes; + const TagName = ordered ? 'ol' : 'ul'; + return ( + + + + ); + }, +}; + /** * New deprecations need to be placed first * for them to have higher priority. @@ -227,4 +314,4 @@ const v2 = { * * See block-deprecation.md */ -export default [ v2, v1, v0 ]; +export default [ v3, v2, v1, v0 ]; diff --git a/post-content.php b/post-content.php index 0bdeb30733f6cd..5545a05e87835d 100644 --- a/post-content.php +++ b/post-content.php @@ -61,13 +61,13 @@ -
          -
        • -
        • -
        • -
        • -
        • -
        • Lists like this one of course :)', 'gutenberg' ); ?>
        • +
            +
          • +
          • +
          • +
          • +
          • +
          • Lists like this one of course :)', 'gutenberg' ); ?>
          diff --git a/test/integration/__snapshots__/blocks-raw-handling.test.js.snap b/test/integration/__snapshots__/blocks-raw-handling.test.js.snap index 071870a4208174..59bcba07275ecd 100644 --- a/test/integration/__snapshots__/blocks-raw-handling.test.js.snap +++ b/test/integration/__snapshots__/blocks-raw-handling.test.js.snap @@ -135,8 +135,8 @@ exports[`rawHandler should convert HTML post to blocks with minimal content chan -
            -
          1. Item
          2. +
              +
            1. Item
            @@ -177,10 +177,10 @@ exports[`rawHandler should convert a caption shortcode with link 1`] = ` exports[`rawHandler should convert a list with attributes 1`] = ` " -
              -
            1. 1 -
                -
              1. 1
              2. +
                  +
                1. 1 +
                    +
                  1. 1
                diff --git a/test/integration/blocks-raw-handling.test.js b/test/integration/blocks-raw-handling.test.js index 229fa0ba7761c8..810bcc0ef34012 100644 --- a/test/integration/blocks-raw-handling.test.js +++ b/test/integration/blocks-raw-handling.test.js @@ -177,16 +177,16 @@ describe( 'Blocks raw handling', () => { .join( '' ); expect( filtered ).toMatchInlineSnapshot( ` - "
                  -
                • one
                • + "
                    +
                  • one
                  • -
                  • two
                  • +
                  • two
                  • -
                  • three
                  • +
                  • three
                  " ` ); expect( console ).toHaveLogged(); @@ -202,16 +202,16 @@ describe( 'Blocks raw handling', () => { .join( '' ); expect( filtered ).toMatchInlineSnapshot( ` - "
                    -
                  • one
                  • + "
                      +
                    • one
                    • -
                    • two
                    • +
                    • two
                    • -
                    • three
                    • +
                    • three
                    " ` ); expect( console ).toHaveLogged(); @@ -318,16 +318,16 @@ describe( 'Blocks raw handling', () => { .join( '' ); expect( filtered ).toMatchInlineSnapshot( ` - "
                      -
                    • One
                    • + "
                        +
                      • One
                      • -
                      • Two
                      • +
                      • Two
                      • -
                      • Three
                      • +
                      • Three
                      " ` ); expect( console ).toHaveLogged(); diff --git a/test/integration/fixtures/blocks/core__list-item.html b/test/integration/fixtures/blocks/core__list-item.html index abeec57ef91988..8eb9e4d57a9163 100644 --- a/test/integration/fixtures/blocks/core__list-item.html +++ b/test/integration/fixtures/blocks/core__list-item.html @@ -1,3 +1,3 @@ -
                    • Text & Headings
                    • +
                    • Text & Headings
                    • diff --git a/test/integration/fixtures/blocks/core__list-item.parsed.json b/test/integration/fixtures/blocks/core__list-item.parsed.json index 29966c6490c59d..0fff75693189be 100644 --- a/test/integration/fixtures/blocks/core__list-item.parsed.json +++ b/test/integration/fixtures/blocks/core__list-item.parsed.json @@ -3,7 +3,9 @@ "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                    • Text & Headings
                    • \n", - "innerContent": [ "\n
                    • Text & Headings
                    • \n" ] + "innerHTML": "\n
                    • Text & Headings
                    • \n", + "innerContent": [ + "\n
                    • Text & Headings
                    • \n" + ] } ] diff --git a/test/integration/fixtures/blocks/core__list-item.serialized.html b/test/integration/fixtures/blocks/core__list-item.serialized.html index abeec57ef91988..8eb9e4d57a9163 100644 --- a/test/integration/fixtures/blocks/core__list-item.serialized.html +++ b/test/integration/fixtures/blocks/core__list-item.serialized.html @@ -1,3 +1,3 @@ -
                    • Text & Headings
                    • +
                    • Text & Headings
                    • diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.html b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.html new file mode 100644 index 00000000000000..ab37d5ca5c6b60 --- /dev/null +++ b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.html @@ -0,0 +1,3 @@ + +
                    • Text
                    • + diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.json b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.json new file mode 100644 index 00000000000000..1a3ec89bddd541 --- /dev/null +++ b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.json @@ -0,0 +1,10 @@ +[ + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "Text" + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json new file mode 100644 index 00000000000000..cbd204b60a1c2a --- /dev/null +++ b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json @@ -0,0 +1,11 @@ +[ + { + "blockName": "core/list-item", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n
                    • Text
                    • \n", + "innerContent": [ + "\n
                    • Text
                    • \n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html new file mode 100644 index 00000000000000..8cc90706933a09 --- /dev/null +++ b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html @@ -0,0 +1,3 @@ + +
                    • Text
                    • + diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html index fa50fb5db17e7b..eda1daa690bcf7 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html @@ -1,13 +1,13 @@ -
                        -
                      • one
                      • +
                          +
                        • one
                        • -
                        • two
                        • +
                        • two
                        • -
                        • three
                        • +
                        • three
                        diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html index 61e33d3dc0e156..be1d0f220331ab 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html @@ -1,26 +1,26 @@ -
                          -
                        • Item -
                            -
                          • Item -
                              -
                            • Item
                            • +
                                +
                              • Item +
                                  +
                                • Item +
                                • -
                                • Item -
                                    -
                                  • Item
                                  • +
                                  • Item +
                                  • -
                                  • Item - diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html index c09708d51db0bb..81b32227abecc8 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html @@ -1,25 +1,25 @@ -
                                      -
                                    • Text & Headings
                                    • +
                                        +
                                      • Text & Headings
                                      • -
                                      • Images & Videos
                                      • +
                                      • Images & Videos
                                      • -
                                      • Galleries
                                      • +
                                      • Galleries
                                      • -
                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                      • +
                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                      • -
                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                      • +
                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                      • -
                                      • And Lists like this one of course :)
                                      • +
                                      • And Lists like this one of course :)
                                      diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json b/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json index 7ddda9e08da5ab..f8c9354e9f44e6 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json +++ b/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json @@ -11,10 +11,16 @@ "attrs": {}, "innerBlocks": [], "innerHTML": "\n\t
                                    • Item 1
                                    • \n\t", - "innerContent": [ "\n\t
                                    • Item 1
                                    • \n\t" ] + "innerContent": [ + "\n\t
                                    • Item 1
                                    • \n\t" + ] } ], "innerHTML": "\n
                                        \n\t\n
                                      \n", - "innerContent": [ "\n
                                        \n\t", null, "\n
                                      \n" ] + "innerContent": [ + "\n
                                        \n\t", + null, + "\n
                                      \n" + ] } ] diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html index 44c97ca29209cf..f7906a4ed961bd 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html @@ -1,5 +1,5 @@ -
                                        -
                                      1. Item 1
                                      2. +
                                          +
                                        1. Item 1
                                        diff --git a/test/integration/fixtures/blocks/core__list__ul.html b/test/integration/fixtures/blocks/core__list__ul.html index c09708d51db0bb..81b32227abecc8 100644 --- a/test/integration/fixtures/blocks/core__list__ul.html +++ b/test/integration/fixtures/blocks/core__list__ul.html @@ -1,25 +1,25 @@ -
                                          -
                                        • Text & Headings
                                        • +
                                            +
                                          • Text & Headings
                                          • -
                                          • Images & Videos
                                          • +
                                          • Images & Videos
                                          • -
                                          • Galleries
                                          • +
                                          • Galleries
                                          • -
                                          • Embeds, like YouTube, Tweets, or other WordPress posts.
                                          • +
                                          • Embeds, like YouTube, Tweets, or other WordPress posts.
                                          • -
                                          • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                          • +
                                          • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                          • -
                                          • And Lists like this one of course :)
                                          • +
                                          • And Lists like this one of course :)
                                          diff --git a/test/integration/fixtures/blocks/core__list__ul.parsed.json b/test/integration/fixtures/blocks/core__list__ul.parsed.json index 2853bc5558ebe3..1f11425b02d03f 100644 --- a/test/integration/fixtures/blocks/core__list__ul.parsed.json +++ b/test/integration/fixtures/blocks/core__list__ul.parsed.json @@ -7,54 +7,60 @@ "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                        • Text & Headings
                                        • \n", - "innerContent": [ "\n
                                        • Text & Headings
                                        • \n" ] + "innerHTML": "\n
                                        • Text & Headings
                                        • \n", + "innerContent": [ + "\n
                                        • Text & Headings
                                        • \n" + ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                        • Images & Videos
                                        • \n", - "innerContent": [ "\n
                                        • Images & Videos
                                        • \n" ] + "innerHTML": "\n
                                        • Images & Videos
                                        • \n", + "innerContent": [ + "\n
                                        • Images & Videos
                                        • \n" + ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                        • Galleries
                                        • \n", - "innerContent": [ "\n
                                        • Galleries
                                        • \n" ] + "innerHTML": "\n
                                        • Galleries
                                        • \n", + "innerContent": [ + "\n
                                        • Galleries
                                        • \n" + ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                        • Embeds, like YouTube, Tweets, or other WordPress posts.
                                        • \n", + "innerHTML": "\n
                                        • Embeds, like YouTube, Tweets, or other WordPress posts.
                                        • \n", "innerContent": [ - "\n
                                        • Embeds, like YouTube, Tweets, or other WordPress posts.
                                        • \n" + "\n
                                        • Embeds, like YouTube, Tweets, or other WordPress posts.
                                        • \n" ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                        • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                        • \n", + "innerHTML": "\n
                                        • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                        • \n", "innerContent": [ - "\n
                                        • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                        • \n" + "\n
                                        • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                        • \n" ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                        • And Lists like this one of course :)
                                        • \n", + "innerHTML": "\n
                                        • And Lists like this one of course :)
                                        • \n", "innerContent": [ - "\n
                                        • And Lists like this one of course :)
                                        • \n" + "\n
                                        • And Lists like this one of course :)
                                        • \n" ] } ], - "innerHTML": "\n
                                            \n\n\n\n\n\n\n\n\n\n
                                          \n", + "innerHTML": "\n
                                            \n\n\n\n\n\n\n\n\n\n
                                          \n", "innerContent": [ - "\n
                                            ", + "\n
                                              ", null, "\n\n", null, diff --git a/test/integration/fixtures/blocks/core__list__ul.serialized.html b/test/integration/fixtures/blocks/core__list__ul.serialized.html index c09708d51db0bb..81b32227abecc8 100644 --- a/test/integration/fixtures/blocks/core__list__ul.serialized.html +++ b/test/integration/fixtures/blocks/core__list__ul.serialized.html @@ -1,25 +1,25 @@ -
                                                -
                                              • Text & Headings
                                              • +
                                                  +
                                                • Text & Headings
                                                • -
                                                • Images & Videos
                                                • +
                                                • Images & Videos
                                                • -
                                                • Galleries
                                                • +
                                                • Galleries
                                                • -
                                                • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                • +
                                                • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                • -
                                                • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                • +
                                                • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                • -
                                                • And Lists like this one of course :)
                                                • +
                                                • And Lists like this one of course :)
                                                diff --git a/test/integration/fixtures/documents/apple-out.html b/test/integration/fixtures/documents/apple-out.html index d873c942ea9ce1..23c300f562db8b 100644 --- a/test/integration/fixtures/documents/apple-out.html +++ b/test/integration/fixtures/documents/apple-out.html @@ -11,34 +11,34 @@ -
                                                  -
                                                • A
                                                • +
                                                    +
                                                  • A
                                                  • -
                                                  • Bulleted -
                                                      -
                                                    • Indented
                                                    • +
                                                    • Bulleted +
                                                        +
                                                      • Indented
                                                    • -
                                                    • List
                                                    • +
                                                    • List
                                                    -
                                                      -
                                                    1. One
                                                    2. +
                                                        +
                                                      1. One
                                                      2. -
                                                      3. Two
                                                      4. +
                                                      5. Two
                                                      6. -
                                                      7. Three
                                                      8. +
                                                      9. Three
                                                      diff --git a/test/integration/fixtures/documents/evernote-out.html b/test/integration/fixtures/documents/evernote-out.html index 19102ab70dc487..9ecb4f8a566aa6 100644 --- a/test/integration/fixtures/documents/evernote-out.html +++ b/test/integration/fixtures/documents/evernote-out.html @@ -7,38 +7,38 @@ -
                                                        -
                                                      • An
                                                      • +
                                                          +
                                                        • An
                                                        • -
                                                        • Unordered -
                                                            -
                                                          • Indented
                                                          • +
                                                          • Unordered +
                                                              +
                                                            • Indented
                                                          • -
                                                          • List
                                                          • +
                                                          • List
                                                          -
                                                            -
                                                          1. One
                                                          2. +
                                                              +
                                                            1. One
                                                            2. -
                                                            3. Two -
                                                                -
                                                              1. Indented
                                                              2. +
                                                              3. Two +
                                                                  +
                                                                1. Indented
                                                              4. -
                                                              5. Three
                                                              6. +
                                                              7. Three
                                                              diff --git a/test/integration/fixtures/documents/google-docs-list-only-out.html b/test/integration/fixtures/documents/google-docs-list-only-out.html index 642dc168bb5bb9..fa60c750496888 100644 --- a/test/integration/fixtures/documents/google-docs-list-only-out.html +++ b/test/integration/fixtures/documents/google-docs-list-only-out.html @@ -1,21 +1,21 @@ -
                                                                -
                                                              • My first list item -
                                                                  -
                                                                • A sub list item
                                                                • +
                                                                    +
                                                                  • My first list item +
                                                                      +
                                                                    • A sub list item
                                                                    • -
                                                                    • A second sub list item
                                                                    • +
                                                                    • A second sub list item
                                                                  • -
                                                                  • My second list item
                                                                  • +
                                                                  • My second list item
                                                                  • -
                                                                  • My third list item
                                                                  • +
                                                                  • My third list item
                                                                  \ No newline at end of file diff --git a/test/integration/fixtures/documents/google-docs-out.html b/test/integration/fixtures/documents/google-docs-out.html index e88311fab7b1f6..9c8f6d335d606a 100644 --- a/test/integration/fixtures/documents/google-docs-out.html +++ b/test/integration/fixtures/documents/google-docs-out.html @@ -11,34 +11,34 @@

                                                                  This is a heading

                                                                  -
                                                                    -
                                                                  • A
                                                                  • +
                                                                      +
                                                                    • A
                                                                    • -
                                                                    • Bulleted -
                                                                        -
                                                                      • Indented
                                                                      • +
                                                                      • Bulleted +
                                                                          +
                                                                        • Indented
                                                                      • -
                                                                      • List
                                                                      • +
                                                                      • List
                                                                      -
                                                                        -
                                                                      1. One
                                                                      2. +
                                                                          +
                                                                        1. One
                                                                        2. -
                                                                        3. Two
                                                                        4. +
                                                                        5. Two
                                                                        6. -
                                                                        7. Three
                                                                        8. +
                                                                        9. Three
                                                                        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..9c8f6d335d606a 100644 --- a/test/integration/fixtures/documents/google-docs-with-comments-out.html +++ b/test/integration/fixtures/documents/google-docs-with-comments-out.html @@ -11,34 +11,34 @@

                                                                        This is a heading

                                                                        -
                                                                          -
                                                                        • A
                                                                        • +
                                                                            +
                                                                          • A
                                                                          • -
                                                                          • Bulleted -
                                                                              -
                                                                            • Indented
                                                                            • +
                                                                            • Bulleted +
                                                                                +
                                                                              • Indented
                                                                            • -
                                                                            • List
                                                                            • +
                                                                            • List
                                                                            -
                                                                              -
                                                                            1. One
                                                                            2. +
                                                                                +
                                                                              1. One
                                                                              2. -
                                                                              3. Two
                                                                              4. +
                                                                              5. Two
                                                                              6. -
                                                                              7. Three
                                                                              8. +
                                                                              9. Three
                                                                              diff --git a/test/integration/fixtures/documents/markdown-out.html b/test/integration/fixtures/documents/markdown-out.html index 31fa8dacbebf0a..8a7542b7f8b7fd 100644 --- a/test/integration/fixtures/documents/markdown-out.html +++ b/test/integration/fixtures/documents/markdown-out.html @@ -15,34 +15,34 @@

                                                                              Lists

                                                                              -
                                                                                -
                                                                              • A
                                                                              • +
                                                                                  +
                                                                                • A
                                                                                • -
                                                                                • Bulleted -
                                                                                    -
                                                                                  • Indented
                                                                                  • +
                                                                                  • Bulleted +
                                                                                      +
                                                                                    • Indented
                                                                                  • -
                                                                                  • List
                                                                                  • +
                                                                                  • List
                                                                                  -
                                                                                    -
                                                                                  1. One
                                                                                  2. +
                                                                                      +
                                                                                    1. One
                                                                                    2. -
                                                                                    3. Two
                                                                                    4. +
                                                                                    5. Two
                                                                                    6. -
                                                                                    7. Three
                                                                                    8. +
                                                                                    9. Three
                                                                                    diff --git a/test/integration/fixtures/documents/ms-word-list-out.html b/test/integration/fixtures/documents/ms-word-list-out.html index f57946f64bc985..10388ac4f848d2 100644 --- a/test/integration/fixtures/documents/ms-word-list-out.html +++ b/test/integration/fixtures/documents/ms-word-list-out.html @@ -7,16 +7,16 @@

                                                                                    This is a headline?

                                                                                    -
                                                                                      -
                                                                                    • One
                                                                                    • +
                                                                                        +
                                                                                      • One
                                                                                      • -
                                                                                      • Two
                                                                                      • +
                                                                                      • Two
                                                                                      • -
                                                                                      • Three
                                                                                      • +
                                                                                      • Three
                                                                                      diff --git a/test/integration/fixtures/documents/ms-word-online-out.html b/test/integration/fixtures/documents/ms-word-online-out.html index 398281520f2542..66a20db9825c36 100644 --- a/test/integration/fixtures/documents/ms-word-online-out.html +++ b/test/integration/fixtures/documents/ms-word-online-out.html @@ -7,34 +7,34 @@ -
                                                                                        -
                                                                                      • +
                                                                                          +
                                                                                        • -
                                                                                        • Bulleted 
                                                                                        • +
                                                                                        • Bulleted 
                                                                                        • -
                                                                                        • Indented 
                                                                                        • +
                                                                                        • Indented 
                                                                                        • -
                                                                                        • List 
                                                                                        • +
                                                                                        • List 
                                                                                        -
                                                                                          -
                                                                                        1. One 
                                                                                        2. +
                                                                                            +
                                                                                          1. One 
                                                                                          2. -
                                                                                          3. Two 
                                                                                          4. +
                                                                                          5. Two 
                                                                                          6. -
                                                                                          7. Three 
                                                                                          8. +
                                                                                          9. Three 
                                                                                          diff --git a/test/integration/fixtures/documents/ms-word-out.html b/test/integration/fixtures/documents/ms-word-out.html index 98992494032b3e..02d092ce6f7a72 100644 --- a/test/integration/fixtures/documents/ms-word-out.html +++ b/test/integration/fixtures/documents/ms-word-out.html @@ -19,34 +19,34 @@

                                                                                          This is a heading level 2

                                                                                          -
                                                                                            -
                                                                                          • A
                                                                                          • +
                                                                                              +
                                                                                            • A
                                                                                            • -
                                                                                            • Bulleted -
                                                                                                -
                                                                                              • Indented
                                                                                              • +
                                                                                              • Bulleted +
                                                                                                  +
                                                                                                • Indented
                                                                                              • -
                                                                                              • List
                                                                                              • +
                                                                                              • List
                                                                                              -
                                                                                                -
                                                                                              1. One
                                                                                              2. +
                                                                                                  +
                                                                                                1. One
                                                                                                2. -
                                                                                                3. Two
                                                                                                4. +
                                                                                                5. Two
                                                                                                6. -
                                                                                                7. Three
                                                                                                8. +
                                                                                                9. Three
                                                                                                From 71332b453e59f0361fb3837a2b6ff93ec7048c94 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Fri, 24 Nov 2023 13:48:42 +0100 Subject: [PATCH 04/16] Try to update tests by adding bock class names --- test/e2e/specs/editor/blocks/list.spec.js | 342 +++++++++++----------- 1 file changed, 171 insertions(+), 171 deletions(-) diff --git a/test/e2e/specs/editor/blocks/list.spec.js b/test/e2e/specs/editor/blocks/list.spec.js index 48d50a862a50b4..52cd7033b6f1bb 100644 --- a/test/e2e/specs/editor/blocks/list.spec.js +++ b/test/e2e/specs/editor/blocks/list.spec.js @@ -23,12 +23,12 @@ test.describe( 'List (@firefox)', () => { await page.keyboard.type( 'Another list item' ); await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                  -
                                                                                                • A list item
                                                                                                • +
                                                                                                    +
                                                                                                  • A list item
                                                                                                  • -
                                                                                                  • Another list item
                                                                                                  • +
                                                                                                  • Another list item
                                                                                                  ` ); @@ -48,8 +48,8 @@ test.describe( 'List (@firefox)', () => { await page.keyboard.type( '* ' ); await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                    -
                                                                                                  • test
                                                                                                  • +
                                                                                                      +
                                                                                                    • test
                                                                                                    ` ); @@ -67,8 +67,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                      -
                                                                                                    1. A list item
                                                                                                    2. +
                                                                                                        +
                                                                                                      1. A list item
                                                                                                      ` ); @@ -234,8 +234,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                        -
                                                                                                      • I’m a list
                                                                                                      • +
                                                                                                          +
                                                                                                        • I’m a list
                                                                                                        ` ); @@ -253,8 +253,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                          -
                                                                                                        • test
                                                                                                        • +
                                                                                                            +
                                                                                                          • test
                                                                                                          ` ); @@ -279,12 +279,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                            -
                                                                                                          • one
                                                                                                          • +
                                                                                                              +
                                                                                                            • one
                                                                                                            • -
                                                                                                            • two
                                                                                                            • +
                                                                                                            • two
                                                                                                            ` ); @@ -305,12 +305,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                              -
                                                                                                            • one
                                                                                                            • +
                                                                                                                +
                                                                                                              • one
                                                                                                              • -
                                                                                                              • two
                                                                                                              • +
                                                                                                              • two
                                                                                                              ` ); @@ -338,12 +338,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                -
                                                                                                              • one
                                                                                                                ...
                                                                                                              • +
                                                                                                                  +
                                                                                                                • one
                                                                                                                  ...
                                                                                                                • -
                                                                                                                • two
                                                                                                                • +
                                                                                                                • two
                                                                                                                ` ); @@ -403,12 +403,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                -
                                                                                                                  -
                                                                                                                • one
                                                                                                                • +
                                                                                                                    +
                                                                                                                  • one
                                                                                                                  • -
                                                                                                                  • two
                                                                                                                  • +
                                                                                                                  • two
                                                                                                                ` @@ -427,8 +427,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                  -
                                                                                                                • one
                                                                                                                • +
                                                                                                                    +
                                                                                                                  • one
                                                                                                                  @@ -443,12 +443,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                    -
                                                                                                                  • one
                                                                                                                  • +
                                                                                                                      +
                                                                                                                    • one
                                                                                                                    • -
                                                                                                                    • two
                                                                                                                    • +
                                                                                                                    • two
                                                                                                                    ` ); @@ -468,16 +468,16 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                      -
                                                                                                                    • one
                                                                                                                    • +
                                                                                                                        +
                                                                                                                      • one
                                                                                                                      • -
                                                                                                                      • +
                                                                                                                      • -
                                                                                                                      • two
                                                                                                                      • +
                                                                                                                      • two
                                                                                                                      ` ); @@ -486,8 +486,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                        -
                                                                                                                      • one
                                                                                                                      • +
                                                                                                                          +
                                                                                                                        • one
                                                                                                                        @@ -496,8 +496,8 @@ test.describe( 'List (@firefox)', () => { -
                                                                                                                          -
                                                                                                                        • two
                                                                                                                        • +
                                                                                                                            +
                                                                                                                          • two
                                                                                                                          ` ); @@ -511,16 +511,16 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                            -
                                                                                                                          • one
                                                                                                                          • +
                                                                                                                              +
                                                                                                                            • one
                                                                                                                            • -
                                                                                                                            • +
                                                                                                                            • -
                                                                                                                            • two
                                                                                                                            • +
                                                                                                                            • two
                                                                                                                            ` ); @@ -607,8 +607,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                              -
                                                                                                                            1. one
                                                                                                                            2. +
                                                                                                                                +
                                                                                                                              1. one
                                                                                                                              @@ -617,8 +617,8 @@ test.describe( 'List (@firefox)', () => { -
                                                                                                                                -
                                                                                                                              1. two
                                                                                                                              2. +
                                                                                                                                  +
                                                                                                                                1. two
                                                                                                                                ` ); @@ -635,14 +635,14 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                  -
                                                                                                                                • one -
                                                                                                                                    -
                                                                                                                                  • two
                                                                                                                                  • +
                                                                                                                                      +
                                                                                                                                    • one +
                                                                                                                                        +
                                                                                                                                      • two
                                                                                                                                      • -
                                                                                                                                      • three
                                                                                                                                      • +
                                                                                                                                      • three
                                                                                                                                    @@ -661,10 +661,10 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                      -
                                                                                                                                    • one -
                                                                                                                                        -
                                                                                                                                      • +
                                                                                                                                          +
                                                                                                                                        • one +
                                                                                                                                            +
                                                                                                                                        @@ -678,8 +678,8 @@ test.describe( 'List (@firefox)', () => { await editor.clickBlockToolbarButton( 'Ordered' ); await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                          -
                                                                                                                                        1. +
                                                                                                                                            +
                                                                                                                                          ` ); @@ -699,10 +699,10 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                            -
                                                                                                                                          • a -
                                                                                                                                              -
                                                                                                                                            1. 1
                                                                                                                                            2. +
                                                                                                                                                +
                                                                                                                                              • a +
                                                                                                                                                  +
                                                                                                                                                1. 1
                                                                                                                                              @@ -724,8 +724,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                              -
                                                                                                                                                -
                                                                                                                                              • aaa
                                                                                                                                              • +
                                                                                                                                                  +
                                                                                                                                                • aaa
                                                                                                                                                @@ -745,10 +745,10 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                  -
                                                                                                                                                • a -
                                                                                                                                                    -
                                                                                                                                                  • 1
                                                                                                                                                  • +
                                                                                                                                                      +
                                                                                                                                                    • a +
                                                                                                                                                        +
                                                                                                                                                      • 1
                                                                                                                                                    @@ -759,12 +759,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                      -
                                                                                                                                                    • a
                                                                                                                                                    • +
                                                                                                                                                        +
                                                                                                                                                      • a
                                                                                                                                                      • -
                                                                                                                                                      • 1
                                                                                                                                                      • +
                                                                                                                                                      • 1
                                                                                                                                                      ` ); @@ -782,12 +782,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                        -
                                                                                                                                                      • a -
                                                                                                                                                          -
                                                                                                                                                        • 1 -
                                                                                                                                                            -
                                                                                                                                                          • i
                                                                                                                                                          • +
                                                                                                                                                              +
                                                                                                                                                            • a +
                                                                                                                                                                +
                                                                                                                                                              • 1 +
                                                                                                                                                                  +
                                                                                                                                                                • i
                                                                                                                                                              @@ -800,14 +800,14 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                -
                                                                                                                                                              • a -
                                                                                                                                                                  -
                                                                                                                                                                • 1
                                                                                                                                                                • +
                                                                                                                                                                    +
                                                                                                                                                                  • a +
                                                                                                                                                                      +
                                                                                                                                                                    • 1
                                                                                                                                                                    • -
                                                                                                                                                                    • i
                                                                                                                                                                    • +
                                                                                                                                                                    • i
                                                                                                                                                                  @@ -821,16 +821,16 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                    -
                                                                                                                                                                  • a -
                                                                                                                                                                      -
                                                                                                                                                                    • 1
                                                                                                                                                                    • +
                                                                                                                                                                        +
                                                                                                                                                                      • a +
                                                                                                                                                                          +1
                                                                                                                                                                      • -
                                                                                                                                                                      • i
                                                                                                                                                                      • +
                                                                                                                                                                      • i
                                                                                                                                                                      ` ); @@ -852,12 +852,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                        -
                                                                                                                                                                      • a -
                                                                                                                                                                          -
                                                                                                                                                                        • b -
                                                                                                                                                                            -
                                                                                                                                                                          • c
                                                                                                                                                                          • +
                                                                                                                                                                              +
                                                                                                                                                                            • a +
                                                                                                                                                                                +
                                                                                                                                                                              • b +
                                                                                                                                                                                  +
                                                                                                                                                                                • c
                                                                                                                                                                              @@ -871,14 +871,14 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                -
                                                                                                                                                                              • a
                                                                                                                                                                              • +
                                                                                                                                                                                  +
                                                                                                                                                                                • a
                                                                                                                                                                                • -
                                                                                                                                                                                • b -
                                                                                                                                                                                    -
                                                                                                                                                                                  • c
                                                                                                                                                                                  • +
                                                                                                                                                                                  • b +
                                                                                                                                                                                      +
                                                                                                                                                                                    • c
                                                                                                                                                                                  @@ -897,8 +897,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                    -
                                                                                                                                                                                  • a
                                                                                                                                                                                  • +
                                                                                                                                                                                      +
                                                                                                                                                                                    • a
                                                                                                                                                                                    ` ); @@ -920,16 +920,16 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                      -
                                                                                                                                                                                    • a
                                                                                                                                                                                    • +
                                                                                                                                                                                        +
                                                                                                                                                                                      • a
                                                                                                                                                                                      • -
                                                                                                                                                                                      • b
                                                                                                                                                                                      • +
                                                                                                                                                                                      • b
                                                                                                                                                                                      • -
                                                                                                                                                                                      • c
                                                                                                                                                                                      • +
                                                                                                                                                                                      • c
                                                                                                                                                                                      ` ); @@ -951,12 +951,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                        -
                                                                                                                                                                                      • 1 -
                                                                                                                                                                                          -
                                                                                                                                                                                        • a -
                                                                                                                                                                                            -
                                                                                                                                                                                          • i
                                                                                                                                                                                          • +
                                                                                                                                                                                              +
                                                                                                                                                                                            • 1 +
                                                                                                                                                                                                +
                                                                                                                                                                                              • a +
                                                                                                                                                                                                  +
                                                                                                                                                                                                • i
                                                                                                                                                                                              @@ -970,14 +970,14 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                -
                                                                                                                                                                                              • 1 -
                                                                                                                                                                                                  -
                                                                                                                                                                                                • a
                                                                                                                                                                                                • +
                                                                                                                                                                                                    +
                                                                                                                                                                                                  • 1 +
                                                                                                                                                                                                      +
                                                                                                                                                                                                    • a
                                                                                                                                                                                                    • -
                                                                                                                                                                                                    • +
                                                                                                                                                                                                  @@ -988,16 +988,16 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                    -
                                                                                                                                                                                                  • 1 -
                                                                                                                                                                                                      -
                                                                                                                                                                                                    • a
                                                                                                                                                                                                    • +
                                                                                                                                                                                                        +
                                                                                                                                                                                                      • 1 +
                                                                                                                                                                                                          +
                                                                                                                                                                                                        • a
                                                                                                                                                                                                      • -
                                                                                                                                                                                                      • +
                                                                                                                                                                                                      ` ); @@ -1006,10 +1006,10 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                        -
                                                                                                                                                                                                      • 1 -
                                                                                                                                                                                                          -
                                                                                                                                                                                                        • a
                                                                                                                                                                                                        • +
                                                                                                                                                                                                            +
                                                                                                                                                                                                          • 1 +
                                                                                                                                                                                                              +
                                                                                                                                                                                                            • a
                                                                                                                                                                                                          @@ -1021,12 +1021,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                            -
                                                                                                                                                                                                          • 1
                                                                                                                                                                                                          • +
                                                                                                                                                                                                              +
                                                                                                                                                                                                            • 1
                                                                                                                                                                                                            • -
                                                                                                                                                                                                            • +
                                                                                                                                                                                                            ` ); @@ -1035,8 +1035,8 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                              -
                                                                                                                                                                                                            • 1
                                                                                                                                                                                                            • +
                                                                                                                                                                                                                +
                                                                                                                                                                                                              • 1
                                                                                                                                                                                                              ` ); @@ -1068,14 +1068,14 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                -
                                                                                                                                                                                                              • 1
                                                                                                                                                                                                              • +
                                                                                                                                                                                                                  +
                                                                                                                                                                                                                • 1
                                                                                                                                                                                                                • -
                                                                                                                                                                                                                • 2 -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                  • a
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                  • 2 +
                                                                                                                                                                                                                      +
                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                  @@ -1098,12 +1098,12 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                    -
                                                                                                                                                                                                                  • 1
                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                      +
                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                    ` ); @@ -1152,14 +1152,14 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                      -
                                                                                                                                                                                                                    • 1 -
                                                                                                                                                                                                                        -
                                                                                                                                                                                                                      • 2
                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                          +
                                                                                                                                                                                                                        • 1 +
                                                                                                                                                                                                                            +
                                                                                                                                                                                                                          • 2
                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                          • 3
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                          • 3
                                                                                                                                                                                                                        @@ -1178,14 +1178,14 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                          -
                                                                                                                                                                                                                        • 1 -
                                                                                                                                                                                                                            -
                                                                                                                                                                                                                          • 2
                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                              +
                                                                                                                                                                                                                            • 1 +
                                                                                                                                                                                                                                +
                                                                                                                                                                                                                              • 2
                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                              • 3
                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                              • 3
                                                                                                                                                                                                                            @@ -1213,8 +1213,8 @@ test.describe( 'List (@firefox)', () => { -
                                                                                                                                                                                                                              -
                                                                                                                                                                                                                            • 2
                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                +
                                                                                                                                                                                                                              • 2
                                                                                                                                                                                                                              ` ); @@ -1238,15 +1238,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                -
                                                                                                                                                                                                                              1. 1
                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                              3. 1
                                                                                                                                                                                                                              4. -
                                                                                                                                                                                                                              5. 2
                                                                                                                                                                                                                              6. +
                                                                                                                                                                                                                              7. 2
                                                                                                                                                                                                                              8. -
                                                                                                                                                                                                                              9. 3
                                                                                                                                                                                                                              10. +
                                                                                                                                                                                                                              11. 3
                                                                                                                                                                                                                              ` ); @@ -1269,16 +1269,16 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                                -
                                                                                                                                                                                                                              • a
                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                • a
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • b
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • b
                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                • c
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                • c
                                                                                                                                                                                                                                ` ); @@ -1295,8 +1295,8 @@ test.describe( 'List (@firefox)', () => { // Add empty list block await page.getByPlaceholder( 'Start writing with text or HTML' ) .fill( ` -
                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                  ` ); @@ -1305,8 +1305,8 @@ test.describe( 'List (@firefox)', () => { // Verify no WSOD and content is proper. expect( await editor.getEditedPostContent() ).toBe( ` -
                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                    ` ); } ); @@ -1326,18 +1326,18 @@ test.describe( 'List (@firefox)', () => { await page.keyboard.type( '* c' ); await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                      • b
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                      • b
                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                      • c
                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                        • c
                                                                                                                                                                                                                                        ` ); @@ -1345,16 +1345,16 @@ test.describe( 'List (@firefox)', () => { await page.keyboard.press( 'Backspace' ); await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                        • a
                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                          • a
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • b
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • b
                                                                                                                                                                                                                                          • -
                                                                                                                                                                                                                                          • c
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                          • c
                                                                                                                                                                                                                                          ` ); } ); @@ -1368,8 +1368,8 @@ test.describe( 'List (@firefox)', () => { await page.keyboard.type( '1' ); expect( await editor.getEditedPostContent() ).toBe( ` -
                                                                                                                                                                                                                                            -
                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                            @@ -1409,12 +1409,12 @@ test.describe( 'List (@firefox)', () => { await page.getByRole( 'menuitem', { name: 'List' } ).click(); expect( await editor.getEditedPostContent() ).toBe( ` -
                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                            • 1
                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • 1
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • 2
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • 2
                                                                                                                                                                                                                                              ` ); } ); From e9dd9931ea7ec9b41de16a7bc96df25f12156e3b Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 27 Nov 2023 06:59:19 +0100 Subject: [PATCH 05/16] Revert list-item changes --- docs/reference-guides/core-blocks.md | 2 +- lib/blocks.php | 2 +- .../block-library/src/list-item/block.json | 2 +- .../block-library/src/list-item/deprecated.js | 55 ----- packages/block-library/src/list-item/index.js | 2 - .../block-library/src/list-item/index.php | 48 ----- post-content.php | 12 +- test/e2e/specs/editor/blocks/list.spec.js | 204 +++++++++--------- .../blocks-raw-handling.test.js.snap | 6 +- test/integration/blocks-raw-handling.test.js | 18 +- .../fixtures/blocks/core__list-item.html | 2 +- .../blocks/core__list-item.parsed.json | 6 +- .../blocks/core__list-item.serialized.html | 2 +- .../blocks/core__list-item_deprecated-v1.html | 3 - .../blocks/core__list-item_deprecated-v1.json | 10 - .../core__list-item_deprecated-v1.parsed.json | 11 - ...e__list-item_deprecated-v1.serialized.html | 3 - .../core__list__deprecated-v0.serialized.html | 6 +- ...list__deprecated-v1-nested.serialized.html | 14 +- .../core__list__deprecated-v1.serialized.html | 12 +- .../core__list__deprecated-v2.parsed.json | 10 +- .../core__list__deprecated-v2.serialized.html | 2 +- .../fixtures/blocks/core__list__ul.html | 12 +- .../blocks/core__list__ul.parsed.json | 30 ++- .../blocks/core__list__ul.serialized.html | 12 +- .../fixtures/documents/apple-out.html | 14 +- .../fixtures/documents/evernote-out.html | 16 +- .../documents/google-docs-list-only-out.html | 10 +- .../fixtures/documents/google-docs-out.html | 14 +- .../google-docs-with-comments-out.html | 14 +- .../fixtures/documents/markdown-out.html | 14 +- .../fixtures/documents/ms-word-list-out.html | 6 +- .../documents/ms-word-online-out.html | 14 +- .../fixtures/documents/ms-word-out.html | 14 +- 34 files changed, 228 insertions(+), 374 deletions(-) delete mode 100644 packages/block-library/src/list-item/deprecated.js delete mode 100644 packages/block-library/src/list-item/index.php delete mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.html delete mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.json delete mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json delete mode 100644 test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 8e54b26f66ec79..4f598f95c4a9a2 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -415,7 +415,7 @@ Create a list item. ([Source](https://github.com/WordPress/gutenberg/tree/trunk/ - **Name:** core/list-item - **Category:** text - **Parent:** core/list -- **Supports:** className, typography (fontSize, lineHeight) +- **Supports:** typography (fontSize, lineHeight), ~~className~~ - **Attributes:** content, placeholder ## Login/out diff --git a/lib/blocks.php b/lib/blocks.php index 5bdfe757f9d9e9..e8b899d5a97daf 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -26,6 +26,7 @@ function gutenberg_reregister_core_block_types() { 'form-submit-button', 'group', 'html', + 'list-item', 'media-text', 'missing', 'more', @@ -76,7 +77,6 @@ function gutenberg_reregister_core_block_types() { 'latest-comments.php' => 'core/latest-comments', 'latest-posts.php' => 'core/latest-posts', 'list.php' => 'core/list', - 'list-item.php' => 'core/list-item', 'loginout.php' => 'core/loginout', 'navigation.php' => 'core/navigation', 'navigation-link.php' => 'core/navigation-link', diff --git a/packages/block-library/src/list-item/block.json b/packages/block-library/src/list-item/block.json index 16817e523cb6b6..41221f1c31772e 100644 --- a/packages/block-library/src/list-item/block.json +++ b/packages/block-library/src/list-item/block.json @@ -20,7 +20,7 @@ } }, "supports": { - "className": true, + "className": false, "__experimentalSelector": "li", "typography": { "fontSize": true, diff --git a/packages/block-library/src/list-item/deprecated.js b/packages/block-library/src/list-item/deprecated.js deleted file mode 100644 index a748a3693ae887..00000000000000 --- a/packages/block-library/src/list-item/deprecated.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * WordPress dependencies - */ -import { RichText, InnerBlocks, useBlockProps } from '@wordpress/block-editor'; - -// Version without block support 'className: true'. -const v1 = { - attributes: { - placeholder: { - type: 'string', - }, - content: { - type: 'string', - source: 'html', - selector: 'li', - default: '', - __experimentalRole: 'content', - }, - }, - supports: { - className: false, - __experimentalSelector: 'li', - typography: { - fontSize: true, - lineHeight: true, - __experimentalFontFamily: true, - __experimentalFontWeight: true, - __experimentalFontStyle: true, - __experimentalTextTransform: true, - __experimentalTextDecoration: true, - __experimentalLetterSpacing: true, - __experimentalDefaultControls: { - fontSize: true, - }, - }, - }, - save( { attributes } ) { - return ( -
                                                                                                                                                                                                                                            • - - -
                                                                                                                                                                                                                                            • - ); - }, -}; - -/** - * New deprecations need to be placed first - * for them to have higher priority. - * - * Old deprecations may need to be updated as well. - * - * See block-deprecation.md - */ -export default [ v1 ]; diff --git a/packages/block-library/src/list-item/index.js b/packages/block-library/src/list-item/index.js index e593c518680f56..00adc1c2c40266 100644 --- a/packages/block-library/src/list-item/index.js +++ b/packages/block-library/src/list-item/index.js @@ -11,7 +11,6 @@ import metadata from './block.json'; import edit from './edit'; import save from './save'; import transforms from './transforms'; -import deprecated from './deprecated'; const { name } = metadata; @@ -28,7 +27,6 @@ export const settings = { }; }, transforms, - deprecated, }; export const init = () => initBlock( { name, metadata, settings } ); diff --git a/packages/block-library/src/list-item/index.php b/packages/block-library/src/list-item/index.php deleted file mode 100644 index b4e0585d241c02..00000000000000 --- a/packages/block-library/src/list-item/index.php +++ /dev/null @@ -1,48 +0,0 @@ - would be transformed to
                                                                                                                                                                                                                                            • . - * - * @see https://github.com/WordPress/gutenberg/issues/12420 - * - * @param array $attributes Attributes of the block being rendered. - * @param string $content Content of the block being rendered. - * - * @return string The content of the block being rendered. - */ -function block_core_list_item_render( $attributes, $content ) { - if ( ! $content ) { - return $content; - } - - $processor = new WP_HTML_Tag_Processor( $content ); - - while ( $processor->next_tag() ) { - if ( 'LI' === $processor->get_tag() ) { - $processor->add_class( 'wp-block-list-item' ); - break; - } - } - - return $processor->get_updated_html(); -} - -/** - * Registers the `core/list-item` block on server. - */ -function register_block_core_list_item() { - register_block_type_from_metadata( - __DIR__ . '/list-item', - array( - 'render_callback' => 'block_core_list_item_render', - ) - ); -} - -add_action( 'init', 'register_block_core_list_item' ); diff --git a/post-content.php b/post-content.php index 5545a05e87835d..3c9b18087b0e84 100644 --- a/post-content.php +++ b/post-content.php @@ -62,12 +62,12 @@
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • Lists like this one of course :)', 'gutenberg' ); ?>
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • Lists like this one of course :)', 'gutenberg' ); ?>
                                                                                                                                                                                                                                              diff --git a/test/e2e/specs/editor/blocks/list.spec.js b/test/e2e/specs/editor/blocks/list.spec.js index 52cd7033b6f1bb..06bbc0bdf618b0 100644 --- a/test/e2e/specs/editor/blocks/list.spec.js +++ b/test/e2e/specs/editor/blocks/list.spec.js @@ -24,11 +24,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • A list item
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • A list item
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • Another list item
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • Another list item
                                                                                                                                                                                                                                              ` ); @@ -49,7 +49,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • test
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • test
                                                                                                                                                                                                                                              ` ); @@ -68,7 +68,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              1. A list item
                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                              3. A list item
                                                                                                                                                                                                                                              ` ); @@ -235,7 +235,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • I’m a list
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • I’m a list
                                                                                                                                                                                                                                              ` ); @@ -254,7 +254,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • test
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • test
                                                                                                                                                                                                                                              ` ); @@ -280,11 +280,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` ); @@ -306,11 +306,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` ); @@ -339,11 +339,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                                ...
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                                ...
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` ); @@ -404,11 +404,11 @@ test.describe( 'List (@firefox)', () => { `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` @@ -428,7 +428,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              @@ -444,11 +444,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` ); @@ -469,15 +469,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` ); @@ -487,7 +487,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              @@ -497,7 +497,7 @@ test.describe( 'List (@firefox)', () => {
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` ); @@ -512,15 +512,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • two
                                                                                                                                                                                                                                              ` ); @@ -608,7 +608,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              1. one
                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                              3. one
                                                                                                                                                                                                                                              @@ -618,7 +618,7 @@ test.describe( 'List (@firefox)', () => {
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              1. two
                                                                                                                                                                                                                                              2. +
                                                                                                                                                                                                                                              3. two
                                                                                                                                                                                                                                              ` ); @@ -636,13 +636,13 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                • two
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • two
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • three
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • three
                                                                                                                                                                                                                                              @@ -662,9 +662,9 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • one +
                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                              @@ -679,7 +679,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              1. +
                                                                                                                                                                                                                                              ` ); @@ -700,9 +700,9 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • a +
                                                                                                                                                                                                                                              • a
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                1. 1
                                                                                                                                                                                                                                                2. +
                                                                                                                                                                                                                                                3. 1
                                                                                                                                                                                                                                              @@ -725,7 +725,7 @@ test.describe( 'List (@firefox)', () => { `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • aaa
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • aaa
                                                                                                                                                                                                                                              @@ -746,9 +746,9 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • a +
                                                                                                                                                                                                                                              • a
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                • 1
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • 1
                                                                                                                                                                                                                                              @@ -760,11 +760,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • a
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • a
                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                              • 1
                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                              • 1
                                                                                                                                                                                                                                              ` ); @@ -783,11 +783,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                              • a +
                                                                                                                                                                                                                                              • a
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                • 1 +
                                                                                                                                                                                                                                                • 1
                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                  • i
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • i
                                                                                                                                                                                                                                                @@ -801,13 +801,13 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                • a +
                                                                                                                                                                                                                                                • a
                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                  • 1
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • 1
                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                  • i
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • i
                                                                                                                                                                                                                                                @@ -822,15 +822,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                • a +
                                                                                                                                                                                                                                                • a
                                                                                                                                                                                                                                                    -1 +
                                                                                                                                                                                                                                                  • 1
                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                • i
                                                                                                                                                                                                                                                • +
                                                                                                                                                                                                                                                • i
                                                                                                                                                                                                                                                ` ); @@ -853,11 +853,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                • a +
                                                                                                                                                                                                                                                • a
                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                  • b +
                                                                                                                                                                                                                                                  • b
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                  @@ -872,13 +872,13 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                  • a
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • a
                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                  • b +
                                                                                                                                                                                                                                                  • b
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                  @@ -898,7 +898,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                  • a
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • a
                                                                                                                                                                                                                                                  ` ); @@ -921,15 +921,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                  • a
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • a
                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                  • b
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • b
                                                                                                                                                                                                                                                  • -
                                                                                                                                                                                                                                                  • c
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • c
                                                                                                                                                                                                                                                  ` ); @@ -952,11 +952,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                  • 1 +
                                                                                                                                                                                                                                                  • 1
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • a +
                                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • i
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • i
                                                                                                                                                                                                                                                    @@ -971,13 +971,13 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1 +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                    @@ -989,15 +989,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1 +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    ` ); @@ -1007,9 +1007,9 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1 +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                    @@ -1022,11 +1022,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    ` ); @@ -1036,7 +1036,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    ` ); @@ -1069,13 +1069,13 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • 2 +
                                                                                                                                                                                                                                                    • 2
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • a
                                                                                                                                                                                                                                                    @@ -1099,11 +1099,11 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    ` ); @@ -1153,13 +1153,13 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1 +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • 2
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • 2
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • 3
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • 3
                                                                                                                                                                                                                                                    @@ -1179,13 +1179,13 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1 +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • 2
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • 2
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • 3
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • 3
                                                                                                                                                                                                                                                    @@ -1214,7 +1214,7 @@ test.describe( 'List (@firefox)', () => {
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 2
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • 2
                                                                                                                                                                                                                                                    ` ); @@ -1238,15 +1238,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    1. 1
                                                                                                                                                                                                                                                    2. +
                                                                                                                                                                                                                                                    3. 1
                                                                                                                                                                                                                                                    4. -
                                                                                                                                                                                                                                                    5. 2
                                                                                                                                                                                                                                                    6. +
                                                                                                                                                                                                                                                    7. 2
                                                                                                                                                                                                                                                    8. -
                                                                                                                                                                                                                                                    9. 3
                                                                                                                                                                                                                                                    10. +
                                                                                                                                                                                                                                                    11. 3
                                                                                                                                                                                                                                                    ` ); @@ -1270,15 +1270,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • b
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • b
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    ` ); @@ -1296,7 +1296,7 @@ test.describe( 'List (@firefox)', () => { await page.getByPlaceholder( 'Start writing with text or HTML' ) .fill( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    ` ); @@ -1306,7 +1306,7 @@ test.describe( 'List (@firefox)', () => { // Verify no WSOD and content is proper. expect( await editor.getEditedPostContent() ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    ` ); } ); @@ -1327,17 +1327,17 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • b
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • b
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    ` ); @@ -1346,15 +1346,15 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • a
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • b
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • b
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • c
                                                                                                                                                                                                                                                    ` ); } ); @@ -1369,7 +1369,7 @@ test.describe( 'List (@firefox)', () => { expect( await editor.getEditedPostContent() ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    @@ -1410,11 +1410,11 @@ test.describe( 'List (@firefox)', () => { expect( await editor.getEditedPostContent() ).toBe( `
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • 1
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • 2
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • 2
                                                                                                                                                                                                                                                    ` ); } ); diff --git a/test/integration/__snapshots__/blocks-raw-handling.test.js.snap b/test/integration/__snapshots__/blocks-raw-handling.test.js.snap index 59bcba07275ecd..291f280e2f697e 100644 --- a/test/integration/__snapshots__/blocks-raw-handling.test.js.snap +++ b/test/integration/__snapshots__/blocks-raw-handling.test.js.snap @@ -136,7 +136,7 @@ exports[`rawHandler should convert HTML post to blocks with minimal content chan
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    1. Item
                                                                                                                                                                                                                                                    2. +
                                                                                                                                                                                                                                                    3. Item
                                                                                                                                                                                                                                                    @@ -178,9 +178,9 @@ exports[`rawHandler should convert a caption shortcode with link 1`] = ` exports[`rawHandler should convert a list with attributes 1`] = ` "
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    1. 1 +
                                                                                                                                                                                                                                                    2. 1
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. 1
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. 1
                                                                                                                                                                                                                                                    diff --git a/test/integration/blocks-raw-handling.test.js b/test/integration/blocks-raw-handling.test.js index 810bcc0ef34012..ac571f2bf4243d 100644 --- a/test/integration/blocks-raw-handling.test.js +++ b/test/integration/blocks-raw-handling.test.js @@ -178,15 +178,15 @@ describe( 'Blocks raw handling', () => { expect( filtered ).toMatchInlineSnapshot( ` "
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • one
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • one
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • two
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • two
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • three
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • three
                                                                                                                                                                                                                                                    " ` ); expect( console ).toHaveLogged(); @@ -203,15 +203,15 @@ describe( 'Blocks raw handling', () => { expect( filtered ).toMatchInlineSnapshot( ` "
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • one
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • one
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • two
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • two
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • three
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • three
                                                                                                                                                                                                                                                    " ` ); expect( console ).toHaveLogged(); @@ -319,15 +319,15 @@ describe( 'Blocks raw handling', () => { expect( filtered ).toMatchInlineSnapshot( ` "
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • One
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • One
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • Two
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • Two
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • Three
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • Three
                                                                                                                                                                                                                                                    " ` ); expect( console ).toHaveLogged(); diff --git a/test/integration/fixtures/blocks/core__list-item.html b/test/integration/fixtures/blocks/core__list-item.html index 8eb9e4d57a9163..abeec57ef91988 100644 --- a/test/integration/fixtures/blocks/core__list-item.html +++ b/test/integration/fixtures/blocks/core__list-item.html @@ -1,3 +1,3 @@ -
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • diff --git a/test/integration/fixtures/blocks/core__list-item.parsed.json b/test/integration/fixtures/blocks/core__list-item.parsed.json index 0fff75693189be..29966c6490c59d 100644 --- a/test/integration/fixtures/blocks/core__list-item.parsed.json +++ b/test/integration/fixtures/blocks/core__list-item.parsed.json @@ -3,9 +3,7 @@ "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • \n", - "innerContent": [ - "\n
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • \n" - ] + "innerHTML": "\n
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • \n", + "innerContent": [ "\n
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • \n" ] } ] diff --git a/test/integration/fixtures/blocks/core__list-item.serialized.html b/test/integration/fixtures/blocks/core__list-item.serialized.html index 8eb9e4d57a9163..abeec57ef91988 100644 --- a/test/integration/fixtures/blocks/core__list-item.serialized.html +++ b/test/integration/fixtures/blocks/core__list-item.serialized.html @@ -1,3 +1,3 @@ -
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                  • Text & Headings
                                                                                                                                                                                                                                                  • diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.html b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.html deleted file mode 100644 index ab37d5ca5c6b60..00000000000000 --- a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.html +++ /dev/null @@ -1,3 +0,0 @@ - -
                                                                                                                                                                                                                                                  • Text
                                                                                                                                                                                                                                                  • - diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.json b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.json deleted file mode 100644 index 1a3ec89bddd541..00000000000000 --- a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "name": "core/list-item", - "isValid": true, - "attributes": { - "content": "Text" - }, - "innerBlocks": [] - } -] diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json deleted file mode 100644 index cbd204b60a1c2a..00000000000000 --- a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.parsed.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "blockName": "core/list-item", - "attrs": {}, - "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                  • Text
                                                                                                                                                                                                                                                  • \n", - "innerContent": [ - "\n
                                                                                                                                                                                                                                                  • Text
                                                                                                                                                                                                                                                  • \n" - ] - } -] diff --git a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html deleted file mode 100644 index 8cc90706933a09..00000000000000 --- a/test/integration/fixtures/blocks/core__list-item_deprecated-v1.serialized.html +++ /dev/null @@ -1,3 +0,0 @@ - -
                                                                                                                                                                                                                                                  • Text
                                                                                                                                                                                                                                                  • - diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html index eda1daa690bcf7..ad0919beb9bde4 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v0.serialized.html @@ -1,13 +1,13 @@
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • one
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • one
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • two
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • two
                                                                                                                                                                                                                                                    • -
                                                                                                                                                                                                                                                    • three
                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                    • three
                                                                                                                                                                                                                                                    diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html index be1d0f220331ab..39a3efa2eabed8 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v1-nested.serialized.html @@ -1,26 +1,26 @@
                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                    • Item +
                                                                                                                                                                                                                                                    • Item diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html index 81b32227abecc8..4d74394771fcb5 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v1.serialized.html @@ -1,25 +1,25 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • Text & Headings
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Text & Headings
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Images & Videos
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Images & Videos
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Galleries
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Galleries
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • And Lists like this one of course :)
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • And Lists like this one of course :)
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json b/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json index f8c9354e9f44e6..7ddda9e08da5ab 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json +++ b/test/integration/fixtures/blocks/core__list__deprecated-v2.parsed.json @@ -11,16 +11,10 @@ "attrs": {}, "innerBlocks": [], "innerHTML": "\n\t
                                                                                                                                                                                                                                                    • Item 1
                                                                                                                                                                                                                                                    • \n\t", - "innerContent": [ - "\n\t
                                                                                                                                                                                                                                                    • Item 1
                                                                                                                                                                                                                                                    • \n\t" - ] + "innerContent": [ "\n\t
                                                                                                                                                                                                                                                    • Item 1
                                                                                                                                                                                                                                                    • \n\t" ] } ], "innerHTML": "\n
                                                                                                                                                                                                                                                        \n\t\n
                                                                                                                                                                                                                                                      \n", - "innerContent": [ - "\n
                                                                                                                                                                                                                                                        \n\t", - null, - "\n
                                                                                                                                                                                                                                                      \n" - ] + "innerContent": [ "\n
                                                                                                                                                                                                                                                        \n\t", null, "\n
                                                                                                                                                                                                                                                      \n" ] } ] diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html index f7906a4ed961bd..6fdf3ad84feeb9 100644 --- a/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html +++ b/test/integration/fixtures/blocks/core__list__deprecated-v2.serialized.html @@ -1,5 +1,5 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. Item 1
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. Item 1
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/blocks/core__list__ul.html b/test/integration/fixtures/blocks/core__list__ul.html index 81b32227abecc8..4d74394771fcb5 100644 --- a/test/integration/fixtures/blocks/core__list__ul.html +++ b/test/integration/fixtures/blocks/core__list__ul.html @@ -1,25 +1,25 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • Text & Headings
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Text & Headings
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Images & Videos
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Images & Videos
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Galleries
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Galleries
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • And Lists like this one of course :)
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • And Lists like this one of course :)
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/blocks/core__list__ul.parsed.json b/test/integration/fixtures/blocks/core__list__ul.parsed.json index 1f11425b02d03f..4639b007c777b7 100644 --- a/test/integration/fixtures/blocks/core__list__ul.parsed.json +++ b/test/integration/fixtures/blocks/core__list__ul.parsed.json @@ -7,54 +7,48 @@ "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                    • Text & Headings
                                                                                                                                                                                                                                                    • \n", - "innerContent": [ - "\n
                                                                                                                                                                                                                                                    • Text & Headings
                                                                                                                                                                                                                                                    • \n" - ] + "innerHTML": "\n
                                                                                                                                                                                                                                                    • Text & Headings
                                                                                                                                                                                                                                                    • \n", + "innerContent": [ "\n
                                                                                                                                                                                                                                                    • Text & Headings
                                                                                                                                                                                                                                                    • \n" ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                    • Images & Videos
                                                                                                                                                                                                                                                    • \n", - "innerContent": [ - "\n
                                                                                                                                                                                                                                                    • Images & Videos
                                                                                                                                                                                                                                                    • \n" - ] + "innerHTML": "\n
                                                                                                                                                                                                                                                    • Images & Videos
                                                                                                                                                                                                                                                    • \n", + "innerContent": [ "\n
                                                                                                                                                                                                                                                    • Images & Videos
                                                                                                                                                                                                                                                    • \n" ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                    • Galleries
                                                                                                                                                                                                                                                    • \n", - "innerContent": [ - "\n
                                                                                                                                                                                                                                                    • Galleries
                                                                                                                                                                                                                                                    • \n" - ] + "innerHTML": "\n
                                                                                                                                                                                                                                                    • Galleries
                                                                                                                                                                                                                                                    • \n", + "innerContent": [ "\n
                                                                                                                                                                                                                                                    • Galleries
                                                                                                                                                                                                                                                    • \n" ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                    • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                    • \n", + "innerHTML": "\n
                                                                                                                                                                                                                                                    • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                    • \n", "innerContent": [ - "\n
                                                                                                                                                                                                                                                    • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                    • \n" + "\n
                                                                                                                                                                                                                                                    • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                    • \n" ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                    • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                    • \n", + "innerHTML": "\n
                                                                                                                                                                                                                                                    • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                    • \n", "innerContent": [ - "\n
                                                                                                                                                                                                                                                    • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                    • \n" + "\n
                                                                                                                                                                                                                                                    • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                    • \n" ] }, { "blockName": "core/list-item", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
                                                                                                                                                                                                                                                    • And Lists like this one of course :)
                                                                                                                                                                                                                                                    • \n", + "innerHTML": "\n
                                                                                                                                                                                                                                                    • And Lists like this one of course :)
                                                                                                                                                                                                                                                    • \n", "innerContent": [ - "\n
                                                                                                                                                                                                                                                    • And Lists like this one of course :)
                                                                                                                                                                                                                                                    • \n" + "\n
                                                                                                                                                                                                                                                    • And Lists like this one of course :)
                                                                                                                                                                                                                                                    • \n" ] } ], diff --git a/test/integration/fixtures/blocks/core__list__ul.serialized.html b/test/integration/fixtures/blocks/core__list__ul.serialized.html index 81b32227abecc8..4d74394771fcb5 100644 --- a/test/integration/fixtures/blocks/core__list__ul.serialized.html +++ b/test/integration/fixtures/blocks/core__list__ul.serialized.html @@ -1,25 +1,25 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • Text & Headings
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Text & Headings
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Images & Videos
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Images & Videos
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Galleries
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Galleries
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Embeds, like YouTube, Tweets, or other WordPress posts.
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Layout blocks, like Buttons, Hero Images, Separators, etc.
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • And Lists like this one of course :)
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • And Lists like this one of course :)
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/documents/apple-out.html b/test/integration/fixtures/documents/apple-out.html index 23c300f562db8b..9fe4c1b1bbcf32 100644 --- a/test/integration/fixtures/documents/apple-out.html +++ b/test/integration/fixtures/documents/apple-out.html @@ -12,33 +12,33 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Bulleted +
                                                                                                                                                                                                                                                      • Bulleted
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. One
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. One
                                                                                                                                                                                                                                                      4. -
                                                                                                                                                                                                                                                      5. Two
                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                      7. Two
                                                                                                                                                                                                                                                      8. -
                                                                                                                                                                                                                                                      9. Three
                                                                                                                                                                                                                                                      10. +
                                                                                                                                                                                                                                                      11. Three
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/documents/evernote-out.html b/test/integration/fixtures/documents/evernote-out.html index 9ecb4f8a566aa6..e58a205bd7787d 100644 --- a/test/integration/fixtures/documents/evernote-out.html +++ b/test/integration/fixtures/documents/evernote-out.html @@ -8,37 +8,37 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • An
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • An
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Unordered +
                                                                                                                                                                                                                                                      • Unordered
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. One
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. One
                                                                                                                                                                                                                                                      4. -
                                                                                                                                                                                                                                                      5. Two +
                                                                                                                                                                                                                                                      6. Two
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        1. Indented
                                                                                                                                                                                                                                                        2. +
                                                                                                                                                                                                                                                        3. Indented
                                                                                                                                                                                                                                                      7. -
                                                                                                                                                                                                                                                      8. Three
                                                                                                                                                                                                                                                      9. +
                                                                                                                                                                                                                                                      10. Three
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/documents/google-docs-list-only-out.html b/test/integration/fixtures/documents/google-docs-list-only-out.html index fa60c750496888..ec14d44d2b9224 100644 --- a/test/integration/fixtures/documents/google-docs-list-only-out.html +++ b/test/integration/fixtures/documents/google-docs-list-only-out.html @@ -1,21 +1,21 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • My first list item +
                                                                                                                                                                                                                                                      • My first list item
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        • A sub list item
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • A sub list item
                                                                                                                                                                                                                                                        • -
                                                                                                                                                                                                                                                        • A second sub list item
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • A second sub list item
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • My second list item
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • My second list item
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • My third list item
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • My third list item
                                                                                                                                                                                                                                                      \ No newline at end of file diff --git a/test/integration/fixtures/documents/google-docs-out.html b/test/integration/fixtures/documents/google-docs-out.html index 9c8f6d335d606a..e00e9d922c1bab 100644 --- a/test/integration/fixtures/documents/google-docs-out.html +++ b/test/integration/fixtures/documents/google-docs-out.html @@ -12,33 +12,33 @@

                                                                                                                                                                                                                                                      This is a heading

                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Bulleted +
                                                                                                                                                                                                                                                      • Bulleted
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. One
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. One
                                                                                                                                                                                                                                                      4. -
                                                                                                                                                                                                                                                      5. Two
                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                      7. Two
                                                                                                                                                                                                                                                      8. -
                                                                                                                                                                                                                                                      9. Three
                                                                                                                                                                                                                                                      10. +
                                                                                                                                                                                                                                                      11. Three
                                                                                                                                                                                                                                                      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 9c8f6d335d606a..e00e9d922c1bab 100644 --- a/test/integration/fixtures/documents/google-docs-with-comments-out.html +++ b/test/integration/fixtures/documents/google-docs-with-comments-out.html @@ -12,33 +12,33 @@

                                                                                                                                                                                                                                                      This is a heading

                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Bulleted +
                                                                                                                                                                                                                                                      • Bulleted
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. One
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. One
                                                                                                                                                                                                                                                      4. -
                                                                                                                                                                                                                                                      5. Two
                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                      7. Two
                                                                                                                                                                                                                                                      8. -
                                                                                                                                                                                                                                                      9. Three
                                                                                                                                                                                                                                                      10. +
                                                                                                                                                                                                                                                      11. Three
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/documents/markdown-out.html b/test/integration/fixtures/documents/markdown-out.html index 8a7542b7f8b7fd..958f4a9d764e42 100644 --- a/test/integration/fixtures/documents/markdown-out.html +++ b/test/integration/fixtures/documents/markdown-out.html @@ -16,33 +16,33 @@

                                                                                                                                                                                                                                                      Lists

                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Bulleted +
                                                                                                                                                                                                                                                      • Bulleted
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. One
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. One
                                                                                                                                                                                                                                                      4. -
                                                                                                                                                                                                                                                      5. Two
                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                      7. Two
                                                                                                                                                                                                                                                      8. -
                                                                                                                                                                                                                                                      9. Three
                                                                                                                                                                                                                                                      10. +
                                                                                                                                                                                                                                                      11. Three
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/documents/ms-word-list-out.html b/test/integration/fixtures/documents/ms-word-list-out.html index 10388ac4f848d2..2e55413b159a6a 100644 --- a/test/integration/fixtures/documents/ms-word-list-out.html +++ b/test/integration/fixtures/documents/ms-word-list-out.html @@ -8,15 +8,15 @@

                                                                                                                                                                                                                                                      This is a headline?

                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • One
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • One
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Two
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Two
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Three
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Three
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/documents/ms-word-online-out.html b/test/integration/fixtures/documents/ms-word-online-out.html index 66a20db9825c36..7ee5bf7b83e7d0 100644 --- a/test/integration/fixtures/documents/ms-word-online-out.html +++ b/test/integration/fixtures/documents/ms-word-online-out.html @@ -8,33 +8,33 @@
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Bulleted 
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Bulleted 
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Indented 
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • Indented 
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • List 
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • List 
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. One 
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. One 
                                                                                                                                                                                                                                                      4. -
                                                                                                                                                                                                                                                      5. Two 
                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                      7. Two 
                                                                                                                                                                                                                                                      8. -
                                                                                                                                                                                                                                                      9. Three 
                                                                                                                                                                                                                                                      10. +
                                                                                                                                                                                                                                                      11. Three 
                                                                                                                                                                                                                                                      diff --git a/test/integration/fixtures/documents/ms-word-out.html b/test/integration/fixtures/documents/ms-word-out.html index 02d092ce6f7a72..0b37d15db9577f 100644 --- a/test/integration/fixtures/documents/ms-word-out.html +++ b/test/integration/fixtures/documents/ms-word-out.html @@ -20,33 +20,33 @@

                                                                                                                                                                                                                                                      This is a heading level 2

                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • A
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • Bulleted +
                                                                                                                                                                                                                                                      • Bulleted
                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                        • Indented
                                                                                                                                                                                                                                                      • -
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      • List
                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                      1. One
                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                      3. One
                                                                                                                                                                                                                                                      4. -
                                                                                                                                                                                                                                                      5. Two
                                                                                                                                                                                                                                                      6. +
                                                                                                                                                                                                                                                      7. Two
                                                                                                                                                                                                                                                      8. -
                                                                                                                                                                                                                                                      9. Three
                                                                                                                                                                                                                                                      10. +
                                                                                                                                                                                                                                                      11. Three
                                                                                                                                                                                                                                                      From 9f7b68f84c01c090d148a66fa6d19764c07bd95f Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 27 Nov 2023 08:11:08 +0100 Subject: [PATCH 06/16] Remove the experimental selector from block.json --- packages/block-library/src/list/block.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/block-library/src/list/block.json b/packages/block-library/src/list/block.json index c2847db5d8c500..b0dab438e9e1aa 100644 --- a/packages/block-library/src/list/block.json +++ b/packages/block-library/src/list/block.json @@ -68,7 +68,6 @@ } }, "__unstablePasteTextInline": true, - "__experimentalSelector": "ol,ul", "__experimentalOnMerge": true, "__experimentalSlashInserter": true }, From eb6341c83eda8e96767a84bbcd0c17a95cdf5063 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 27 Nov 2023 08:36:16 +0100 Subject: [PATCH 07/16] Add fixture for deprecation v3 --- .../core__list__deprecated-v3-css-class.html | 3 + .../core__list__deprecated-v3-css-class.json | 60 +++++++++++++++++++ ..._list__deprecated-v3-css-class.parsed.json | 11 ++++ ...t__deprecated-v3-css-class.serialized.html | 25 ++++++++ 4 files changed, 99 insertions(+) create mode 100644 test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.html create mode 100644 test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.json create mode 100644 test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.parsed.json create mode 100644 test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.serialized.html diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.html b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.html new file mode 100644 index 00000000000000..aef6bf669f2c98 --- /dev/null +++ b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.html @@ -0,0 +1,3 @@ + +
                                                                                                                                                                                                                                                      • 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 :)
                                                                                                                                                                                                                                                      + diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.json b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.json new file mode 100644 index 00000000000000..80cd87e4eb69e8 --- /dev/null +++ b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.json @@ -0,0 +1,60 @@ +[ + { + "name": "core/list", + "isValid": true, + "attributes": { + "ordered": false, + "values": "" + }, + "innerBlocks": [ + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "Text & Headings" + }, + "innerBlocks": [] + }, + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "Images & Videos" + }, + "innerBlocks": [] + }, + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "Galleries" + }, + "innerBlocks": [] + }, + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "Embeds, like YouTube, Tweets, or other WordPress posts." + }, + "innerBlocks": [] + }, + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "Layout blocks, like Buttons, Hero Images, Separators, etc." + }, + "innerBlocks": [] + }, + { + "name": "core/list-item", + "isValid": true, + "attributes": { + "content": "And Lists like this one of course :)" + }, + "innerBlocks": [] + } + ] + } +] diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.parsed.json b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.parsed.json new file mode 100644 index 00000000000000..427f4c3a975cfd --- /dev/null +++ b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.parsed.json @@ -0,0 +1,11 @@ +[ + { + "blockName": "core/list", + "attrs": {}, + "innerBlocks": [], + "innerHTML": "\n
                                                                                                                                                                                                                                                      • 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 :)
                                                                                                                                                                                                                                                      \n", + "innerContent": [ + "\n
                                                                                                                                                                                                                                                      • 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 :)
                                                                                                                                                                                                                                                      \n" + ] + } +] diff --git a/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.serialized.html b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.serialized.html new file mode 100644 index 00000000000000..4d74394771fcb5 --- /dev/null +++ b/test/integration/fixtures/blocks/core__list__deprecated-v3-css-class.serialized.html @@ -0,0 +1,25 @@ + +
                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      • 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 :)
                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                      + From b1d4d0d703a09e336652c94c9606709e09b5c7b4 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 27 Nov 2023 08:46:46 +0100 Subject: [PATCH 08/16] Update list class names in test files --- test/e2e/specs/editor/blocks/list.spec.js | 2 +- ...y-cut-paste-should-paste-preformatted-in-list-1-chromium.txt | 2 +- test/e2e/specs/editor/various/writing-flow.spec.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/e2e/specs/editor/blocks/list.spec.js b/test/e2e/specs/editor/blocks/list.spec.js index 06bbc0bdf618b0..8e10145f72fbc2 100644 --- a/test/e2e/specs/editor/blocks/list.spec.js +++ b/test/e2e/specs/editor/blocks/list.spec.js @@ -1237,7 +1237,7 @@ test.describe( 'List (@firefox)', () => { await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                        1. 1
                                                                                                                                                                                                                                                        2. diff --git a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-preformatted-in-list-1-chromium.txt b/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-preformatted-in-list-1-chromium.txt index 002e7a19200283..d46df0dfb55d44 100644 --- a/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-preformatted-in-list-1-chromium.txt +++ b/test/e2e/specs/editor/various/__snapshots__/Copy-cut-paste-should-paste-preformatted-in-list-1-chromium.txt @@ -1,5 +1,5 @@ -
                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                            • xy
                                                                                                                                                                                                                                                            \ 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 a248915a21fcba..dff7fb978949f6 100644 --- a/test/e2e/specs/editor/various/writing-flow.spec.js +++ b/test/e2e/specs/editor/various/writing-flow.spec.js @@ -356,7 +356,7 @@ test.describe( 'Writing Flow (@firefox, @webkit)', () => { await page.keyboard.type( 'a' ); await page.keyboard.press( 'Backspace' ); await expect.poll( editor.getEditedPostContent ).toBe( ` -
                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                              ` ); From a205584b409428b86826ba6f42fe98ea5680e94c Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 27 Nov 2023 09:38:29 +0100 Subject: [PATCH 09/16] Update list class names in native test files --- .../__snapshots__/transforms.native.js.snap | 2 +- .../test/__snapshots__/edit.native.js.snap | 22 ++++----- .../__snapshots__/transforms.native.js.snap | 6 +-- .../src/list/test/edit.native.js | 48 +++++++++---------- .../src/list/test/transforms.native.js | 2 +- .../__snapshots__/transforms.native.js.snap | 2 +- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/packages/block-library/src/heading/test/__snapshots__/transforms.native.js.snap b/packages/block-library/src/heading/test/__snapshots__/transforms.native.js.snap index 4f6512b3f86625..c773f863077715 100644 --- a/packages/block-library/src/heading/test/__snapshots__/transforms.native.js.snap +++ b/packages/block-library/src/heading/test/__snapshots__/transforms.native.js.snap @@ -20,7 +20,7 @@ exports[`Heading block transforms to Group block 1`] = ` exports[`Heading block transforms to List block 1`] = ` " -
                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                • Example text
                                                                                                                                                                                                                                                                " diff --git a/packages/block-library/src/list/test/__snapshots__/edit.native.js.snap b/packages/block-library/src/list/test/__snapshots__/edit.native.js.snap index 1bc5cf6ce937f8..058ccc6b9ca635 100644 --- a/packages/block-library/src/list/test/__snapshots__/edit.native.js.snap +++ b/packages/block-library/src/list/test/__snapshots__/edit.native.js.snap @@ -2,7 +2,7 @@ exports[`List block adds one item to the list 1`] = ` " -
                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                  • First list item
                                                                                                                                                                                                                                                                  " @@ -10,9 +10,9 @@ exports[`List block adds one item to the list 1`] = ` exports[`List block changes the indentation level 1`] = ` " -
                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                    • Item 1 -
                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                        • Item 2
                                                                                                                                                                                                                                                                        @@ -22,7 +22,7 @@ exports[`List block changes the indentation level 1`] = ` exports[`List block changes to ordered list 1`] = ` " -
                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                          1. Item 1
                                                                                                                                                                                                                                                                          2. @@ -38,7 +38,7 @@ exports[`List block changes to ordered list 1`] = ` exports[`List block changes to reverse ordered list 1`] = ` " -
                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              1. Item 1
                                                                                                                                                                                                                                                                              2. @@ -54,7 +54,7 @@ exports[`List block changes to reverse ordered list 1`] = ` exports[`List block inserts block 1`] = ` " -
                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                  " @@ -62,7 +62,7 @@ exports[`List block inserts block 1`] = ` exports[`List block removes the indentation level 1`] = ` " -
                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    • Item 1
                                                                                                                                                                                                                                                                                    • @@ -74,7 +74,7 @@ exports[`List block removes the indentation level 1`] = ` exports[`List block sets a start value to an ordered list 1`] = ` " -
                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                        1. Item 1
                                                                                                                                                                                                                                                                                        2. @@ -90,19 +90,19 @@ exports[`List block sets a start value to an ordered list 1`] = ` exports[`List block shows different indentation levels 1`] = ` " -
                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                            • List item 1
                                                                                                                                                                                                                                                                                            • List item 2 -
                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                • List item nested 1
                                                                                                                                                                                                                                                                                                • List item nested 2 -
                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                    • Extra item 1
                                                                                                                                                                                                                                                                                                    • diff --git a/packages/block-library/src/list/test/__snapshots__/transforms.native.js.snap b/packages/block-library/src/list/test/__snapshots__/transforms.native.js.snap index 723d19a658366f..9e28f1c77de943 100644 --- a/packages/block-library/src/list/test/__snapshots__/transforms.native.js.snap +++ b/packages/block-library/src/list/test/__snapshots__/transforms.native.js.snap @@ -4,7 +4,7 @@ exports[`List block transforms to Columns block 1`] = ` "
                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                        • First Item
                                                                                                                                                                                                                                                                                                        • @@ -23,7 +23,7 @@ exports[`List block transforms to Columns block 1`] = ` exports[`List block transforms to Group block 1`] = ` "
                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                            • First Item
                                                                                                                                                                                                                                                                                                            • @@ -69,7 +69,7 @@ exports[`List block transforms to Paragraph block 1`] = ` exports[`List block transforms to Quote block 1`] = ` "
                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                • First Item
                                                                                                                                                                                                                                                                                                                • diff --git a/packages/block-library/src/list/test/edit.native.js b/packages/block-library/src/list/test/edit.native.js index 1f7296db98c8c3..a33bce32e5bca0 100644 --- a/packages/block-library/src/list/test/edit.native.js +++ b/packages/block-library/src/list/test/edit.native.js @@ -60,7 +60,7 @@ describe( 'List block', () => { it( 'adds one item to the list', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                    `; @@ -88,17 +88,17 @@ describe( 'List block', () => { it( 'shows different indentation levels', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                      • List item 1
                                                                                                                                                                                                                                                                                                                      • List item 2 -
                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                          • List item nested 1
                                                                                                                                                                                                                                                                                                                          • List item nested 2 -
                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                              • Extra item 1
                                                                                                                                                                                                                                                                                                                              • @@ -140,7 +140,7 @@ describe( 'List block', () => { it( 'changes the indentation level', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                  • Item 1
                                                                                                                                                                                                                                                                                                                                  • @@ -183,9 +183,9 @@ describe( 'List block', () => { it( 'removes the indentation level', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                      • Item 1 -
                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                          • Item 2
                                                                                                                                                                                                                                                                                                                                          @@ -230,7 +230,7 @@ describe( 'List block', () => { it( 'changes to ordered list', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                            • Item 1
                                                                                                                                                                                                                                                                                                                                            • @@ -258,7 +258,7 @@ describe( 'List block', () => { it( 'changes to reverse ordered list', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                • Item 1
                                                                                                                                                                                                                                                                                                                                                • @@ -299,7 +299,7 @@ describe( 'List block', () => { it( 'sets a start value to an ordered list', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                    • Item 1
                                                                                                                                                                                                                                                                                                                                                    • @@ -342,7 +342,7 @@ describe( 'List block', () => { it( 'splits empty list items into paragraphs', async () => { // Arrange const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        • One
                                                                                                                                                                                                                                                                                                                                                        • Two
                                                                                                                                                                                                                                                                                                                                                        @@ -370,7 +370,7 @@ describe( 'List block', () => { // Assert expect( getEditorHtml() ).toMatchInlineSnapshot( ` " -
                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                          • One
                                                                                                                                                                                                                                                                                                                                                          @@ -380,7 +380,7 @@ describe( 'List block', () => { -
                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                            • Two
                                                                                                                                                                                                                                                                                                                                                            " @@ -389,7 +389,7 @@ describe( 'List block', () => { it( 'merges paragraphs into list items', async () => { const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              • One
                                                                                                                                                                                                                                                                                                                                                              @@ -399,7 +399,7 @@ describe( 'List block', () => { -
                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                • Three
                                                                                                                                                                                                                                                                                                                                                                `; @@ -417,7 +417,7 @@ describe( 'List block', () => { // Assert expect( getEditorHtml() ).toMatchInlineSnapshot( ` " -
                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                  • One
                                                                                                                                                                                                                                                                                                                                                                  • @@ -435,7 +435,7 @@ describe( 'List block', () => { it( 'merges lists into lists', async () => { // Arrange const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                      • One
                                                                                                                                                                                                                                                                                                                                                                      • @@ -445,7 +445,7 @@ describe( 'List block', () => { -
                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                          • Three
                                                                                                                                                                                                                                                                                                                                                                          `; @@ -466,7 +466,7 @@ describe( 'List block', () => { // Assert expect( getEditorHtml() ).toMatchInlineSnapshot( ` " -
                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                            • One
                                                                                                                                                                                                                                                                                                                                                                            • @@ -486,7 +486,7 @@ describe( 'List block', () => {

                                                                                                                                                                                                                                                                                                                                                                              A quick brown fox.

                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                • One
                                                                                                                                                                                                                                                                                                                                                                                • Two
                                                                                                                                                                                                                                                                                                                                                                                `; @@ -527,7 +527,7 @@ describe( 'List block', () => { -
                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                  • Two
                                                                                                                                                                                                                                                                                                                                                                                  " @@ -539,9 +539,9 @@ describe( 'List block', () => {

                                                                                                                                                                                                                                                                                                                                                                                  A quick brown fox.

                                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    • One -
                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                        • Two
                                                                                                                                                                                                                                                                                                                                                                                        • @@ -591,7 +591,7 @@ describe( 'List block', () => { -
                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                            • Two
                                                                                                                                                                                                                                                                                                                                                                                            • diff --git a/packages/block-library/src/list/test/transforms.native.js b/packages/block-library/src/list/test/transforms.native.js index dd8ec5ccd2c772..538d5b7ed0193e 100644 --- a/packages/block-library/src/list/test/transforms.native.js +++ b/packages/block-library/src/list/test/transforms.native.js @@ -12,7 +12,7 @@ import { const block = 'List'; const initialHtml = ` -
                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                • First Item
                                                                                                                                                                                                                                                                                                                                                                                                • diff --git a/packages/block-library/src/paragraph/test/__snapshots__/transforms.native.js.snap b/packages/block-library/src/paragraph/test/__snapshots__/transforms.native.js.snap index b0855c02bd0e96..3a2a928b81f5e8 100644 --- a/packages/block-library/src/paragraph/test/__snapshots__/transforms.native.js.snap +++ b/packages/block-library/src/paragraph/test/__snapshots__/transforms.native.js.snap @@ -32,7 +32,7 @@ exports[`Paragraph block transforms to Heading block 1`] = ` exports[`Paragraph block transforms to List block 1`] = ` " -
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    • Example text
                                                                                                                                                                                                                                                                                                                                                                                                    " From ba7bb784c50a31c2115edf6b15045d5ff1a502b7 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Mon, 27 Nov 2023 12:19:30 +0100 Subject: [PATCH 10/16] change experimentalSelector for the list-item block --- packages/block-library/src/list-item/block.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/list-item/block.json b/packages/block-library/src/list-item/block.json index 41221f1c31772e..d562ef113ea0e7 100644 --- a/packages/block-library/src/list-item/block.json +++ b/packages/block-library/src/list-item/block.json @@ -21,7 +21,7 @@ }, "supports": { "className": false, - "__experimentalSelector": "li", + "__experimentalSelector": ".wp-block-list > li", "typography": { "fontSize": true, "lineHeight": true, From a44b0da35bcc186164a051d4162dc30ea163e37e Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Tue, 2 Jan 2024 10:50:08 +0100 Subject: [PATCH 11/16] Try to fix spacing CS issues in test fixture --- test/integration/fixtures/documents/ms-word-online-out.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/fixtures/documents/ms-word-online-out.html b/test/integration/fixtures/documents/ms-word-online-out.html index e571ca784660a2..98cc96fce609b7 100644 --- a/test/integration/fixtures/documents/ms-word-online-out.html +++ b/test/integration/fixtures/documents/ms-word-online-out.html @@ -8,7 +8,7 @@
                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                    • A
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • @@ -26,7 +26,7 @@
                                                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                                                      1. One
                                                                                                                                                                                                                                                                                                                                                                                                      2. +
                                                                                                                                                                                                                                                                                                                                                                                                      3. One 
                                                                                                                                                                                                                                                                                                                                                                                                      4. From 20fd490a6835874f02622a7335ef6e2730af98a4 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Tue, 2 Jan 2024 12:14:37 +0100 Subject: [PATCH 12/16] Update blocks-raw-handling.native.js --- test/native/integration/blocks-raw-handling.native.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/native/integration/blocks-raw-handling.native.js b/test/native/integration/blocks-raw-handling.native.js index 5f21ca035fbf9d..6fae0e72be0cac 100644 --- a/test/native/integration/blocks-raw-handling.native.js +++ b/test/native/integration/blocks-raw-handling.native.js @@ -187,7 +187,7 @@ describe( 'Blocks raw handling', () => { .join( '' ); expect( filtered ).toMatchInlineSnapshot( ` - "
                                                                                                                                                                                                                                                                                                                                                                                                          + "
                                                                                                                                                                                                                                                                                                                                                                                                          • one
                                                                                                                                                                                                                                                                                                                                                                                                          • @@ -212,7 +212,7 @@ describe( 'Blocks raw handling', () => { .join( '' ); expect( filtered ).toMatchInlineSnapshot( ` - "
                                                                                                                                                                                                                                                                                                                                                                                                              + "
                                                                                                                                                                                                                                                                                                                                                                                                              • one
                                                                                                                                                                                                                                                                                                                                                                                                              • @@ -309,7 +309,7 @@ describe( 'Blocks raw handling', () => { it( 'should treat single list item as inline text', () => { const filtered = pasteHandler( { - HTML: '
                                                                                                                                                                                                                                                                                                                                                                                                                • Some bold text.
                                                                                                                                                                                                                                                                                                                                                                                                                ', + HTML: '
                                                                                                                                                                                                                                                                                                                                                                                                                • Some bold text.
                                                                                                                                                                                                                                                                                                                                                                                                                ', plainText: 'Some bold text.\n', mode: 'AUTO', } ); @@ -320,7 +320,7 @@ describe( 'Blocks raw handling', () => { it( 'should treat multiple list items as a block', () => { const filtered = pasteHandler( { - HTML: '
                                                                                                                                                                                                                                                                                                                                                                                                                • One
                                                                                                                                                                                                                                                                                                                                                                                                                • Two
                                                                                                                                                                                                                                                                                                                                                                                                                • Three
                                                                                                                                                                                                                                                                                                                                                                                                                ', + HTML: '
                                                                                                                                                                                                                                                                                                                                                                                                                • One
                                                                                                                                                                                                                                                                                                                                                                                                                • Two
                                                                                                                                                                                                                                                                                                                                                                                                                • Three
                                                                                                                                                                                                                                                                                                                                                                                                                ', plainText: 'One\nTwo\nThree\n', mode: 'AUTO', } ) @@ -328,7 +328,7 @@ describe( 'Blocks raw handling', () => { .join( '' ); expect( filtered ).toMatchInlineSnapshot( ` - "
                                                                                                                                                                                                                                                                                                                                                                                                                  + "
                                                                                                                                                                                                                                                                                                                                                                                                                  • One
                                                                                                                                                                                                                                                                                                                                                                                                                  • From c2c5a9417fa7e2fe1f73f65555f19afbe16199da Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Tue, 27 Feb 2024 17:33:55 +0100 Subject: [PATCH 13/16] Update core-blocks.md --- docs/reference-guides/core-blocks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 0d14e07a74142e..c35e3a674e563d 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -405,7 +405,7 @@ Create a bulleted or numbered list. ([Source](https://github.com/WordPress/guten - **Name:** core/list - **Category:** text -- **Supports:** __unstablePasteTextInline, anchor, className, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~className~~ +- **Supports:** __unstablePasteTextInline, anchor, className, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight) - **Attributes:** ordered, placeholder, reversed, start, type, values ## List item From a126c43b3bce1c41778d0943a2427467a91b6369 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Fri, 12 Apr 2024 15:47:11 +0200 Subject: [PATCH 14/16] Remove index.php from the list block --- docs/reference-guides/core-blocks.md | 2 +- lib/blocks.php | 2 +- packages/block-library/src/list/block.json | 1 - packages/block-library/src/list/index.php | 49 ---------------------- 4 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 packages/block-library/src/list/index.php diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 6ed0da925fe1f2..f81c1a7a1d3eaa 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -415,7 +415,7 @@ Create a bulleted or numbered list. ([Source](https://github.com/WordPress/guten - **Name:** core/list - **Category:** text - **Allowed Blocks:** core/list-item -- **Supports:** __unstablePasteTextInline, anchor, className, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** __unstablePasteTextInline, anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** ordered, placeholder, reversed, start, type, values ## List item diff --git a/lib/blocks.php b/lib/blocks.php index 679219cc6ff774..eed9142db436a0 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -26,6 +26,7 @@ function gutenberg_reregister_core_block_types() { 'form-submit-button', 'group', 'html', + 'list', 'list-item', 'missing', 'more', @@ -75,7 +76,6 @@ function gutenberg_reregister_core_block_types() { 'heading.php' => 'core/heading', 'latest-comments.php' => 'core/latest-comments', 'latest-posts.php' => 'core/latest-posts', - 'list.php' => 'core/list', 'loginout.php' => 'core/loginout', 'media-text.php' => 'core/media-text', 'navigation.php' => 'core/navigation', diff --git a/packages/block-library/src/list/block.json b/packages/block-library/src/list/block.json index 28eedd07975b54..157aaf7c0cf633 100644 --- a/packages/block-library/src/list/block.json +++ b/packages/block-library/src/list/block.json @@ -39,7 +39,6 @@ "supports": { "anchor": true, "html": false, - "className": true, "typography": { "fontSize": true, "lineHeight": true, diff --git a/packages/block-library/src/list/index.php b/packages/block-library/src/list/index.php deleted file mode 100644 index 931a6e9550e5cd..00000000000000 --- a/packages/block-library/src/list/index.php +++ /dev/null @@ -1,49 +0,0 @@ - would be transformed to
                                                                                                                                                                                                                                                                                                                                                                                                                      . - * - * @see https://github.com/WordPress/gutenberg/issues/12420 - * - * @param array $attributes Attributes of the block being rendered. - * @param string $content Content of the block being rendered. - * - * @return string The content of the block being rendered. - */ -function block_core_list_render( $attributes, $content ) { - if ( ! $content ) { - return $content; - } - - $processor = new WP_HTML_Tag_Processor( $content ); - - $list_tags = array( 'OL', 'UL' ); - while ( $processor->next_tag() ) { - if ( in_array( $processor->get_tag(), $list_tags, true ) ) { - $processor->add_class( 'wp-block-list' ); - break; - } - } - - return $processor->get_updated_html(); -} - -/** - * Registers the `core/list` block on server. - */ -function register_block_core_list() { - register_block_type_from_metadata( - __DIR__ . '/list', - array( - 'render_callback' => 'block_core_list_render', - ) - ); -} - -add_action( 'init', 'register_block_core_list' ); From 18684f10578a62be08bbbc469fa2f39790469c46 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Fri, 19 Apr 2024 10:28:20 +0200 Subject: [PATCH 15/16] e2e Specs: Add the block class name to the markup in list.spec.js. --- test/e2e/specs/editor/blocks/list.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/specs/editor/blocks/list.spec.js b/test/e2e/specs/editor/blocks/list.spec.js index 5858b3b66ef8f6..7c42ad7989aff9 100644 --- a/test/e2e/specs/editor/blocks/list.spec.js +++ b/test/e2e/specs/editor/blocks/list.spec.js @@ -24,7 +24,7 @@ test.describe( 'List (@firefox)', () => { await pageUtils.pressKeys( 'primary+v' ); const copied = ` -
                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                        • one
                                                                                                                                                                                                                                                                                                                                                                                                                        • From a242f0a54cf887c7d678a5585ac13b8916ad1943 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Wed, 8 May 2024 06:52:37 +0200 Subject: [PATCH 16/16] Re-add the index.php file. --- lib/blocks.php | 2 +- packages/block-library/src/list/index.php | 54 +++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 packages/block-library/src/list/index.php diff --git a/lib/blocks.php b/lib/blocks.php index eed9142db436a0..679219cc6ff774 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -26,7 +26,6 @@ function gutenberg_reregister_core_block_types() { 'form-submit-button', 'group', 'html', - 'list', 'list-item', 'missing', 'more', @@ -76,6 +75,7 @@ function gutenberg_reregister_core_block_types() { 'heading.php' => 'core/heading', 'latest-comments.php' => 'core/latest-comments', 'latest-posts.php' => 'core/latest-posts', + 'list.php' => 'core/list', 'loginout.php' => 'core/loginout', 'media-text.php' => 'core/media-text', 'navigation.php' => 'core/navigation', diff --git a/packages/block-library/src/list/index.php b/packages/block-library/src/list/index.php new file mode 100644 index 00000000000000..1bffd813248575 --- /dev/null +++ b/packages/block-library/src/list/index.php @@ -0,0 +1,54 @@ + is transformed to
                                                                                                                                                                                                                                                                                                                                                                                                                            . + * + * @since 6.6.0 + * + * @see https://github.com/WordPress/gutenberg/issues/12420 + * + * @param array $attributes Attributes of the block being rendered. + * @param string $content Content of the block being rendered. + * + * @return string The content of the block being rendered. + */ +function block_core_list_render( $attributes, $content ) { + if ( ! $content ) { + return $content; + } + + $processor = new WP_HTML_Tag_Processor( $content ); + + $list_tags = array( 'OL', 'UL' ); + while ( $processor->next_tag() ) { + if ( in_array( $processor->get_tag(), $list_tags, true ) ) { + $processor->add_class( 'wp-block-list' ); + break; + } + } + + return $processor->get_updated_html(); +} + +/** + * Registers the `core/list` block on server. + * + * @since 6.6.0 + */ +function register_block_core_list() { + register_block_type_from_metadata( + __DIR__ . '/list', + array( + 'render_callback' => 'block_core_list_render', + ) + ); +} + +add_action( 'init', 'register_block_core_list' );