Skip to content

Escaped content in save function is now double-escaped in Gutenberg #201

@westonruter

Description

@westonruter

Given this code block:

<!-- wp:code {"highlightedLines":"2","showLineNumbers":true} -->
<pre class="wp-block-code"><code>if ( true &amp;&amp; false &amp;&amp; 1 &lt; 0 &amp;&amp; 0 > 1 ) {
   // Unreachable &lt;code>!
}</code></pre>
<!-- /wp:code -->

In WordPress 5.5 when Gutenberg is not active, this renders in the editor successfully:

image

However, when Gutenberg v9.1.1 is active, block validation errors occur:

image

Block validation: Expected text `if ( true &amp;&amp; false &amp;&amp; 1 &lt; 0 &amp;&amp; 0 &gt; 1 ) {
   // Unreachable &lt;code&gt;!
}`, saw `if ( true && false && 1 < 0 && 0 > 1 ) {
   // Unreachable <code>!
}`

This did not happen in Gutenberg v9.0.0. It starts to break as of v9.1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions