Skip to content

Commit

Permalink
wp_slash
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Aug 15, 2023
1 parent ea1603a commit dfd972e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/footnotes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function _wp_rest_api_autosave_meta( $autosave ) {
return;
}

update_post_meta( $id, 'footnotes', json_encode( $body['meta']['footnotes'] ) );
update_post_meta( $id, 'footnotes', wp_slash( $body['meta']['footnotes'] ) );
}
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
add_action( 'wp_creating_autosave', '_wp_rest_api_autosave_meta' );
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/specs/editor/various/footnotes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,12 @@ test.describe( 'Footnotes', () => {
// path).
await editor.canvas.click( 'ol.wp-block-footnotes li span' );
await page.keyboard.press( 'End' );
await page.keyboard.type( '3' );
await page.keyboard.type( '3"' );

const previewPage2 = await editor.openPreviewPage();

await expect(
previewPage2.locator( 'ol.wp-block-footnotes li' )
).toHaveText( '123 ↩︎' );
).toHaveText( '123" ↩︎' );
} );
} );

0 comments on commit dfd972e

Please sign in to comment.