diff --git a/packages/block-editor/src/components/rich-text/index.js b/packages/block-editor/src/components/rich-text/index.js index 37104129aaf6ef..b7770120e0afef 100644 --- a/packages/block-editor/src/components/rich-text/index.js +++ b/packages/block-editor/src/components/rich-text/index.js @@ -229,7 +229,7 @@ function RichTextWrapper( __unstableMultilineTag: multilineTag, __unstableDisableFormats: disableFormats, preserveWhiteSpace, - __unstableDependencies: dependencies, + __unstableDependencies: [ ...dependencies, tagName ], __unstableAfterParse: addEditorOnlyFormats, __unstableBeforeSerialize: removeEditorOnlyFormats, __unstableAddInvisibleFormats: addInvisibleFormats, diff --git a/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap b/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap index c2421bc8c80e2f..a07d125536586f 100644 --- a/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap +++ b/packages/e2e-tests/specs/editor/blocks/__snapshots__/list.test.js.snap @@ -200,6 +200,10 @@ exports[`List should insert a line break on shift+enter in a non trailing list i " `; +exports[`List should not change the contents when you change the list type to Unordered 1`] = `"
  • a
  • b
  • c
  • "`; + +exports[`List should not change the contents when you change the list type to Ordered 1`] = `"
  • 1
  • 2
  • 3
  • "`; + exports[`List should not indent list on space with modifier 1`] = ` " diff --git a/packages/e2e-tests/specs/editor/blocks/list.test.js b/packages/e2e-tests/specs/editor/blocks/list.test.js index ddc115e2195c45..b75f79bb7af532 100644 --- a/packages/e2e-tests/specs/editor/blocks/list.test.js +++ b/packages/e2e-tests/specs/editor/blocks/list.test.js @@ -507,4 +507,36 @@ describe( 'List', () => { expect( await getEditedPostContent() ).toMatchSnapshot(); } ); + + it( 'should not change the contents when you change the list type to Ordered', async () => { + await clickBlockAppender(); + await page.keyboard.type( '* 1' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( '2' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( '3' ); + await clickBlockToolbarButton( 'Ordered' ); + + const content = await page.$eval( + '.wp-block-list', + ( el ) => el.innerHTML + ); + expect( content ).toMatchSnapshot(); + } ); + + it( 'should not change the contents when you change the list type to Unordered', async () => { + await clickBlockAppender(); + await page.keyboard.type( '1. a' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( 'b' ); + await page.keyboard.press( 'Enter' ); + await page.keyboard.type( 'c' ); + await clickBlockToolbarButton( 'Unordered' ); + + const content = await page.$eval( + '.wp-block-list', + ( el ) => el.innerHTML + ); + expect( content ).toMatchSnapshot(); + } ); } );