Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Verse Block Preserves Text Formatting (italic, bold, etc.) on Paste #69544

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

dhruvikpatel18
Copy link
Contributor

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

  1. Create a post and insert an empty Verse block
  2. Find a poem that includes italics, for example: https://www.poetryfoundation.org/poems/161828/luh-friends
  3. Copy the poem's text and paste it into the empty Verse block
  4. Verify that the italics are preserved (before this fix, they would be removed)

Testing Instructions for Keyboard

Screenshots or screencast

Before

before_verse.mov

After

after_verse.mov

@dhruvikpatel18 dhruvikpatel18 marked this pull request as ready for review March 12, 2025 12:18
Copy link

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 props-bot label.

Unlinked Accounts

The 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.

Unlinked contributors: jmccall75.

Co-authored-by: dhruvikpatel18 <dhruvik18@git.wordpress.org>
Co-authored-by: Saoming <samuel1337@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Paste [Block] Verse Affects the Verse block labels Mar 12, 2025
Copy link
Contributor

@hbhalodia hbhalodia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentionally added to fix another issue in #27781 / #27660. Let's ensure we're not introducing a regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Verse Affects the Verse block [Feature] Paste [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verse Block: Do Not Strip Text Formatting (italic, bold, etc.)
3 participants