#57642 closed enhancement (fixed)
Updates `wp_render_elements_support()` to use the HTML API
Reported by: | ntsekouras | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 6.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Editor | Keywords: | gutenberg-merge has-patch has-unit-tests |
Focuses: | Cc: |
Description (last modified by )
Replaces the RegEx and PHP string functionality in wp_render_elements_support()
to use the new HTML API (WP_HTML_Tag_Processor
).
Why?
This class was built to quickly and reliably modify HTML tag attributes. It circumvents specific problems, such as matching on the wrong attributes (such as data-custom-class="some value"), overlooking matches (such as class=blue or class='wp-block-group'), writing updates in a way that get overlooked by the browser (by writing to the end of the tag instead of before any potential duplicate attributes), and by writing invalid content to the HTML (such as through a bug in a PCRE pattern greedily matching more than it should).
Reference:
Change History (7)
#1
@
22 months ago
- Summary changed from Backport updates to `wp_render_elements_support` to Backport updates to `wp_render_elements_support` to use html API
This ticket was mentioned in PR #4007 on WordPress/wordpress-develop by @ntsekouras.
22 months ago
#2
- Keywords has-patch added
#4
@
22 months ago
- Description modified (diff)
- Keywords has-unit-tests added
- Milestone changed from Awaiting Review to 6.2
- Summary changed from Backport updates to `wp_render_elements_support` to use html API to Updates `wp_render_elements_support()` to use the HTML API
#5
@
22 months ago
- Owner set to flixos90
- Status changed from new to reviewing
- Type changed from defect (bug) to enhancement
@ntsekouras Changing this to an enhancement as this isn't really a bug :)
I'm going to review this shortly, should be reasonable to commit today or tomorrow before the beta release; otherwise we may want to change it to a "task (blessed)".
@flixos90 commented on PR #4007:
22 months ago
#7
Committed in https://core.trac.wordpress.org/changeset/55235.
Trac ticket: https://core.trac.wordpress.org/ticket/57642
Updates
wp_render_elements_support
to use the new html API.Related GB PR: https://github.com/WordPress/gutenberg/pull/46625