[wp-trac] [WordPress Trac] #50683: Parse content for shortcodes instead of using regex

WordPress Trac noreply at wordpress.org
Mon Jun 17 12:16:18 UTC 2024


#50683: Parse content for shortcodes instead of using regex
-------------------------------------------------+-------------------------
 Reporter:  cfinke                               |       Owner:
                                                 |  johnbillion
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Shortcodes                           |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests early       |     Focuses:
  needs-testing early-like-actually-early        |
  needs-testing-info                             |
-------------------------------------------------+-------------------------

Comment (by dmsnell):

 I've been thinking about the proposed patch quite a bit, and I keep going
 back to some of the fundamental issues with Shortcodes.

 It reminds me that I think we could clarify many of our problems, parsing
 included, if we think about a new breaking change:

  - Shortcodes can only appear inside HTML attributes and text nodes.

 That is, we exclude the ability to use Shortcodes to give a tag its name,
 or add an attribute to an existing tag. If we do this, we could make a
 couple of other changes:

  - Use the HTML API to find them.
  - Re-use the HTML attribute parsing and apply the rules to shortcode
 attributes.

 These are behavioral changes, but I think there's compelling reason to
 consider them apart from this particular issue. They would fit nicely with
 this issue.

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


More information about the wp-trac mailing list