Skip to content

Conversation

@ockham
Copy link
Owner

@ockham ockham commented Aug 20, 2025

Based on WordPress#9469.
In particular, see WordPress#9469 (comment) for the rationale.

Extend an existing test case so that it would break with the previous implementation of WP_Block_Bindings_Processor. Then, change the implementation to use WP_HTML_Text_Replacement, which is more "correct", and fixes the broken test.

TODO

Add more checks in replace_rich_text(), per WordPress#9469 (comment):

Ensure the processor is stopped on an open tag that is not atomic (like SCRIPT), void (like BR), nor foreign content with a self-closing flag (like G in (<svg><g /></svg>).

Trac ticket: https://core.trac.wordpress.org/ticket/63840


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ockham ockham self-assigned this Aug 20, 2025
@ockham ockham changed the title Try/simplify block bindings replace html use text replacement Block Bindings: Allow more generic setting of block attributes (use WP_HTML_Text_Replacement) Aug 20, 2025
@ockham ockham force-pushed the try/simplify-block-bindings-replace-html branch 2 times, most recently from b558a5a to a18e435 Compare August 26, 2025 18:24
@ockham
Copy link
Owner Author

ockham commented Aug 27, 2025

Closing. I've carried over the changes from this PR to WordPress#9469.

@ockham ockham closed this Aug 27, 2025
@ockham ockham deleted the try/simplify-block-bindings-replace-html-use-text-replacement branch August 27, 2025 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants