-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add WP_HTML_Processor
#47573
Add WP_HTML_Processor
#47573
Conversation
Flaky tests detected in 35bd051. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4053307533
|
Closing. Per recent discussions, we're going to unblock the work in the BHE repo by implementing missing features in a subclass of Development of the HTML Processor API is expected to progress more cautiously/slowly, to take into account more exotic HTML constructs; it will happen in (forks of) the |
What?
Part of #44410.
Add
WP_HTML_Processor
, a subclass ofWP_Tag_HTML_Processor
, which allows "broader" access to the parsed HTML, by providing theget_content_inside_balanced_tags()
method, and some related helper methods, such asbalanced_next()
.Why?
This is a requirement for the Block Interactivity API (see WordPress/block-interactivity-experiments#120). Furthermore,
balanced_next()
is also a prerequisite forset_content_inside_balanced_tags()
(see #47036).How?
The code is copy-pasted from @dmsnell's #46345 (which has a much wider scope). I've only applied some formatting, fixed some lint errors, and added some PHPDoc.
Testing Instructions
See unit tests!
TODO
WP_HTML_Processor_Scan_State
@since