Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
westonruter opened this issue Oct 19, 2020 · 1 comment · Fixed by #200
Closed

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

westonruter opened this issue Oct 19, 2020 · 1 comment · Fixed by #200
Labels
bug Something isn't working changelogged

Comments

@westonruter
Copy link
Owner

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.

@westonruter
Copy link
Owner Author

Looks like this issue was introduced with WordPress/gutenberg#24689.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working changelogged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant