[wp-trac] [WordPress Trac] #45387: Valid HTML get mangled on the frontend

WordPress Trac noreply at wordpress.org
Tue Nov 20 19:31:36 UTC 2018


#45387: Valid HTML get mangled on the frontend
--------------------------+------------------------------
 Reporter:  youknowriad   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by pbiron):

 The problem is in `_get_wptexturize_split_regex()` (which is called by
 `wptexturize()`) at https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/formatting.php#L713.

 The regex interprets the `>` in the attribute value as the end of start
 tag (which is why using the character entity does not cause a problem),
 which results in the HTML getting "mangled" on the front end.

 Unfortunately, I don't know how to fix it...I've never been good with
 regex assertions/lookahead/etc.

 The same regex problem also exists in
 [[https://developer.wordpress.org/reference/functions/get_html_split_regex/|get_html_split_regex()]]
 at https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/formatting.php#L673.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45387#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list