Entering ">" into the RichText component causes block validation failure
You can repro this easily via my remix of the Gutenberg Block Kit Glitch project: https://repro-richtext-bug.glitch.me/
Steps to repro:
- Go to https://repro-richtext-bug.glitch.me/
- Type
>into the RichText component -- see that it renders as>(which might be a separate bug) - Refresh the page
Expected behavior:
Should either render as literally >, or it should consistently evaluate the HTML entity and render>.
Actual behavior:
The block gets into a bad state after refreshing: "This block contains unexpected or invalid content"
Error in the console:
Block validation: Block validation failed for `gutenberg-block-kit/remix` (Object).
Content generated by `save` function:
<p class="wp-block-gutenberg-block-kit-remix">></p>
Content retrieved from post body:
<p class="wp-block-gutenberg-block-kit-remix">&gt;</p>
(anonymous) @ validation.js:265
(I verified this also repros when installed in WordPress as well.)
Thanks for taking a look and let me know if there's any way I can help! Gutenberg and the Block Kit on Glitch have been very cool to play with!
Context: Why am I trying to write &gt;, anyway?
I found this bug because I'm writing a rich text code block plugin that lets you write code snippets and also add basic styling to them (so that you can bold part of a code snippet).
My plugin basically works, but RichText renders HTML entities like ">" even when you set the attribute content to the escaped value (which I think is #15636).
I can imagine wanting to write > in a code snippet, so until #15636 is fixed, my workaround was going to be to write &gt;, which is what led me to this bug!