[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:17:51 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):

 @jim5471 yes it gets rendered as
 {{{
 <p><script><!-- code here /--></script></p>
 }}}


 Likewise if you change it to:
 {{{#!php
 <?php
 add_shortcode( 'xxx', function() {
     return "<!-- wp:html --><script>
 var obj = {
     'foo': 'bar',
     'baz': 'qux'
 };

 var json = JSON.stringify(obj);
 </script>
     <!-- /wp:html -->";
 });
 }}}

 It's rendered as:
 {{{
 <p><script>
     <!-- code here /-->
 var obj = {
     'foo': 'bar',
     'baz': 'qux'
 };</p>
 <p>var json = JSON.stringify(obj);
 </script></p>
 }}}

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


More information about the wp-trac mailing list