diff --git a/packages/core-data/src/footnotes/index.js b/packages/core-data/src/footnotes/index.js index b80ba65d142edb..066c0ea37a8240 100644 --- a/packages/core-data/src/footnotes/index.js +++ b/packages/core-data/src/footnotes/index.js @@ -64,7 +64,7 @@ export function updateFootnotesFromMeta( blocks, meta ) { const richTextValue = typeof value === 'string' ? RichTextData.fromHTMLString( value ) - : value; + : new RichTextData( value ); richTextValue.replacements.forEach( ( replacement ) => { if ( replacement.type === 'core/footnote' ) { diff --git a/test/e2e/specs/editor/various/footnotes.spec.js b/test/e2e/specs/editor/various/footnotes.spec.js index 52dde38cac8136..01017b2d2ea2e6 100644 --- a/test/e2e/specs/editor/various/footnotes.spec.js +++ b/test/e2e/specs/editor/various/footnotes.spec.js @@ -60,6 +60,9 @@ test.describe( 'Footnotes', () => { }, ] ); + // Check if the numbers in the editor content updated. + await expect( editor.canvas.locator( '.fn' ) ).toHaveText( '1' ); + await editor.canvas.locator( 'p:text("first paragraph")' ).click(); await editor.showBlockToolbar();