Skip to content

Block Bindings: Allow more generic setting of block attributes (use WP_HTML_Text_Replacement) #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: try/simplify-block-bindings-replace-html
Choose a base branch
from

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
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.

1 participant