[wp-trac] [WordPress Trac] #64196: Command Palette: Refactor enqueue function to remove regex.
WordPress Trac
noreply at wordpress.org
Wed Nov 5 19:41:26 UTC 2025
#64196: Command Palette: Refactor enqueue function to remove regex.
--------------------------+----------------------------
Reporter: cbravobernal | Owner: davidbaumwald
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 6.9
Component: General | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+----------------------------
Comment (by dmsnell):
If the issue is removing content inside of the HTML tags we can still do
that. In reading the PCRE pattern and the comment above it, I
misunderstood the purpose of the existing code. Thanks for highlighting
that @wildworks.
The fix is not much different than the proposed HTML API code. All we have
to do is track depth based on opening and closing tags, or use
`WP_HTML_Processor` and rely on its `get_depth()` report.
That will still resolve a number of issues with the PCRE approach,
including misparses, handling HTML void elements like `HR`, and leaving
potentially-encoded labels in place instead of decoding them.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64196#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list