[wp-trac] [WordPress Trac] #45387: Valid HTML get mangled on the frontend

WordPress Trac noreply at wordpress.org
Fri Mar 18 16:19:14 UTC 2022


#45387: Valid HTML get mangled on the frontend
--------------------------+------------------------------
 Reporter:  youknowriad   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by joshuanan):

 I hope this will get more attention soon. The issue @mcsf mentioned is
 really a pain for JS conditional logic. Consider that the following code
 will throw an error ("Uncaught SyntaxError: '#' not followed by
 identifier") when entered into a Gutenberg HTML block directly or as the
 output of a short code entered in Gutenberg, because & is converted to an
 HTML entity.


 {{{
 <script>

 x = 5;
 y = 10;
 z = 10

 if (x < y) {

   console.log("X is Greater than Y.");
 }
 else if (x !== y && x !== z) {

   console.log("X is Less than Y, But Unique.");
 }
 </script>
 }}}

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


More information about the wp-trac mailing list