#57642 closed enhancement (fixed)
Updates `wp_render_elements_support()` to use the HTML API
| Reported by: | ntsekouras | Owned by: | flixos90 |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.2 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | gutenberg-merge has-patch has-unit-tests |
| Cc: | Focuses: |
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
@
4 years ago
- Summary Backport updates to `wp_render_elements_support` → Backport updates to `wp_render_elements_support` to use html API
This ticket was mentioned in PR #4007 on WordPress/wordpress-develop by @ntsekouras.
4 years ago
#2
- Keywords has-patch added
#4
@
4 years ago
- Description modified (diff)
- Keywords has-unit-tests added
- Milestone Awaiting Review → 6.2
- Summary Backport updates to `wp_render_elements_support` to use html API → Updates `wp_render_elements_support()` to use the HTML API
#5
@
4 years ago
- Owner set to
- Status new → reviewing
- Type defect (bug) → 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:
4 years ago
#7
Committed in https://core.trac.wordpress.org/changeset/55235.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Trac ticket: https://core.trac.wordpress.org/ticket/57642
Updates
wp_render_elements_supportto use the new html API.Related GB PR: https://github.com/WordPress/gutenberg/pull/46625