Open jmccall75 opened 10 months ago
I tested it. I have found the problem.
I think essentially it has to be related to __unstablePastePlainText
If you take a look at these:
https://github.com/WordPress/gutenberg/blob/trunk/packages/block-library/src/verse/edit.js
I think we should either remove using unStablePastePlainText and maybe add another event to check whether the HTML there the text its wrapped has strong or em
Description
When pasting formatted verse (poetry) into the Verse block, the white space is preserved. That's awesome, and a big step toward making it easier for publishers and writers to accurately present poetry online.
However, all text formatting is stripped out when pasting into the verse block, in particular italics and bolds. This doesn't seem to be a technical hurdle, since the paragraph block retains text formatting.
This issue occurs when copying from various sources. I personally tried HTML pages in the browser, Google Docs, .docx, and .rtf.
I assume this must be either an oversight or a choice. I'm guessing oversight, since the Verse block seems to be mostly a port of the Code and Preformat blocks, where removing text formatting make more sense.
But verse (poetry, lyrics, etc.) often use italics, bolds, and similar formatting. Not allowing that to be pasted in creates unnecessary work for content editors, who then must carefully re-add all that formatting.
It also creates confusion and frustration, since it's obvious enough that the paragraph block doesn't strip out these formats.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
WordPress 6.4.2, custom theme, Windows. Tested in Chrome and Firefox. Not using the Gutenberg plugin, just the core block. (Does that mean this bug report should be moved to another repository?)
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