Fix: Verse Block Preserves Text Formatting (italic, bold, etc.) on Paste#69544
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @jmccall75. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Hi, @dhruvikpatel18 Did you get a chance to investigate this further? |
|
Hi @Mamaduka The trade-off with the However, this approach has a significant limitation. By using plain text mode, we sacrifice rich text formatting such as bold and italics, since these formatting elements only exist in the HTML version of the pasted content.
The current implementation forces us to choose between preserving multiline structure OR preserving rich text formatting - we can't have both simultaneously with the current code structure. |
Closes #57624
What?
This PR fixes an issue where text formatting (italic, bold, etc.) is stripped when pasting content into the Verse block.
Why?
When pasting formatted verse (poetry) into the Verse block, whitespace is preserved but all text formatting is stripped out. This creates unnecessary work for content editors who then need to manually re-add all formatting.
The Paragraph block correctly retains text formatting on paste, and the Verse block should behave similarly since verse content (poetry, lyrics, etc.) often uses italics, bolds, and similar formatting.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
before_verse.mov
After
after_verse.mov