[wp-trac] [WordPress Trac] #58366: Shortcode Support Regained but Content Filters are messing with Shortcode HTML

WordPress Trac noreply at wordpress.org
Mon May 22 14:36:17 UTC 2023


#58366: Shortcode Support Regained but Content Filters are messing with Shortcode
HTML
---------------------------+------------------------------
 Reporter:  domainsupport  |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Shortcodes     |     Version:  6.2.2
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+------------------------------

Comment (by bekk):

 Replying to [comment:16 jim5471]:
 > @domainsupport
 >
 > OK - now try the code without any line feeds.
 > It is being wrapped in <p> tags but the code is clean.
 >
 > {{{#!php
 > <?php
 > add_shortcode( 'xxx', function() {
 >       return "<!-- wp:html --><script>var obj = { 'foo': 'bar', 'baz':
 'qux'};var json = JSON.stringify(obj);</script><!-- /wp:html -->";
 > });
 > }}}
 >
 > {{{#!php
 > <p><script>var obj = { 'foo': 'bar', 'baz': 'qux'};var json =
 JSON.stringify(obj);</script></p>
 > }}}

  Right, see [https://developer.wordpress.org/reference/functions/wpautop/]

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


More information about the wp-trac mailing list