gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Pasting plaintext with HTML tags does not display them

Open kirtangajjar opened this issue 3 years ago • 3 comments

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

  1. Copy the below text and paste as plaintext(cnrtl-shift-v) in Gutenberg:
Add width and height attributes to <img> elements
  1. The rendered text will be:
Add width and height attributes to  elements

Screenshots, screen recording, code snippet

Screenshot Here is what comes in console: Screenshot from 2022-01-19 13-58-13

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

kirtangajjar avatar Jan 19 '22 09:01 kirtangajjar

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>

carolinan avatar Jan 24 '22 12:01 carolinan

I have identified the issue in code and will post a fix shortly

kirtangajjar avatar Jan 24 '22 14:01 kirtangajjar

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.

mrfoxtalbot avatar Sep 13 '22 07:09 mrfoxtalbot