[wp-trac] [WordPress Trac] #52517: Shortcodes inside AMP tags do not work
WordPress Trac
noreply at wordpress.org
Thu Nov 11 20:01:08 UTC 2021
#52517: Shortcodes inside AMP tags do not work
--------------------------+------------------------------
Reporter: Krstarica | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version: 4.7
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by Krstarica):
I'm not happy with using shortcode as an attribute, but other approaches
are just way too slow, like parsing HTML.
It seems that the real issue here is that function wp_kses_attr_parse()
which finds all attributes of an HTML element does not work properly. It
assumes hyphen cannot be a part of HTML element.
All AMP tags (e.g. amp-img, amp-video, amp-audio, amp-iframe, amp-form)
contain hyphen and all other custom HTML elements:
https://amp.dev/documentation/guides-and-tutorials/learn/spec/amphtml/
https://html.spec.whatwg.org/multipage/custom-elements.html
The consequence is that shortcodes inside such tags do not work.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52517#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list