[wp-trac] [WordPress Trac] #47014: Tag balancing corrupts Custom Elements

WordPress Trac noreply at wordpress.org
Sat Jun 1 17:58:27 UTC 2019


#47014: Tag balancing corrupts Custom Elements
--------------------------------------+------------------------
 Reporter:  westonruter               |       Owner:  flixos90
     Type:  defect (bug)              |      Status:  reviewing
 Priority:  normal                    |   Milestone:  5.3
Component:  Formatting                |     Version:  2.0.4
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------

Comment (by birgire):

 I really like the effort made by @dmsnell in [attachment:"47014-1.diff"]
 to expand the regex pattern with comments, it's really helpful. I wish
 this would be a standard in core :-)

 I think it would also be nice to have the stripped regex pattern
 available, either as part of an inline comment or vice versa, with the
 expanded version as a comment.

 What do you think about capitalizing the regex comments and end each line
 with a dot, when possible?

 I would suggest adding to the test cases in {{{data_custom_elements()}}},
 to cover all the capturing groups in the regex. Here's an example:

 {{{<my-custom-element data-attribute="value"/>}}}

 to cover the 4th and the 5th capturing groups.

 And e.g. {{{<my-custom-element/>}}} and {{{<my-custom-element />}}} to the
 existing cases for the first three capturing groups.

 Can this be a strict comparison:

 {{{
 $is_single_tag = in_array( $tag, $single_tags );
 }}}

 as flagged by the coding standard check?

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


More information about the wp-trac mailing list