Make WordPress Core

Changes between Initial Version and Version 6 of Ticket #56893


Ignore:
Timestamp:
10/24/2022 06:23:10 AM (2 years ago)
Author:
sabernhardt
Comment:

The automated paragraph bug with scripts in Classic Editor is very old: #2833.

In the block editor, script tags in a paragraph block would behave similarly. However, content within a Custom HTML block should not get the inappropriate tags. Creating that block is easier in Visual mode, but in Code view you could wrap scripts in the wp:html block comments:

<!-- wp:html -->
<script>
console.log('this');
</script>
<!-- /wp:html -->

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #56893

    • Property Component changed from General to Editor
  • Ticket #56893 – Description

    initial v6  
    11adding a simple JavaScript to the code editor and hitting the publish button just adds unnecessary
    22{{{
    3 </br>
     3<br />
    44}}}
    55
    66inside the Javascript which is a sufficient reason to break any JavaScript
    77
    8 How to reproduce, simply add a new post, paste/write any JavaScript and click the publish button to see the black magic
     8How to reproduce: simply add a new post, paste/write any JavaScript and click the publish button to see the black magic
    99
    1010[[Image(https://i.imgur.com/fyrAwtI.png)]]