Skip to content

Patterns: Handle multiline paste as inline content for overrides#71589

Open
BugReportOnWeb wants to merge 1 commit intoWordPress:trunkfrom
BugReportOnWeb:fix/multiline-sync-pattern
Open

Patterns: Handle multiline paste as inline content for overrides#71589
BugReportOnWeb wants to merge 1 commit intoWordPress:trunkfrom
BugReportOnWeb:fix/multiline-sync-pattern

Conversation

@BugReportOnWeb
Copy link
Copy Markdown
Contributor

What?

Closes #71371

This PR fixes and ensure that multiline paste inside synced pattern overrides is treated as inline text instead of creating multiple paragraphs or blocks.

Why?

Previously, any multiline paste inside a synced pattern did nothing. This happened because line breaks were converted into additional paragraph blocks, which would alter the pattern structure. Because of this, the paste was ignored.

How?

  • Added check for synced pattern with overridden parts used for pasting content.
  • When matched, force paste mode to INLINE, so multiline text is inserted with break line instead of extra blocks.

Testing Instructions

  1. Create a synced pattern.
  2. Enable content overrides for the text field.
  3. Paste multiline text into the override field.
    • Expect: All lines stay within the override block.
  4. Paste the same content outside a synced pattern.
    • Expect: Regular behaviour (new paragraphs/blocks).

Screenshots or screencast

Screen.Recording.2025-09-10.at.9.28.22.PM.mov

@BugReportOnWeb BugReportOnWeb marked this pull request as ready for review September 10, 2025 16:39
@github-actions
Copy link
Copy Markdown

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: BugReportOnWeb <devasheeshkaul@git.wordpress.org>
Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: webexpr-dhenriet <dhenriet@git.wordpress.org>

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

@t-hamano t-hamano added [Feature] Paste [Type] Bug An existing feature does not function as intended labels Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

[Pattern] - Unable to paste text into overwritten synchronized pattern

2 participants