gutenberg
gutenberg copied to clipboard
Pasting plaintext with HTML tags does not display them
Description
When we paste a plaintext with HTML tags, Gutenberg skips pasting the tag entirely and just shows the rest of the content.
Step-by-step reproduction instructions
- Copy the below text and paste as plaintext(
cnrtl-shift-v
) in Gutenberg:
Add width and height attributes to <img> elements
- The rendered text will be:
Add width and height attributes to elements
Screenshots, screen recording, code snippet
Here is what comes in console:
Environment info
WordPress version: 5.8.3
Gutenberg version: 12.3.2
Note: I've it with and without the Gutenberg plugin installed. I was able to replicate issues in both cases.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
I can replicate this. WordPress version 5.9-RC3-52619.
And when I select "view html" on the paragraph block where I pasted the plain text, there is only an extra space where the tags would be:
<p>Add width and height attributes to elements</p>
I have identified the issue in code and will post a fix shortly
Thank you for working on this, @kirtangajjar, I can still reproduce the issue.
I commented on the open PR https://github.com/WordPress/gutenberg/pull/38183 to see if we can unblock this.