Skip to content

Fix rich text split error#16

Draft
cursor[bot] wants to merge 1 commit intoupdatesfrom
typeerror-object-is-7d6amc
Draft

Fix rich text split error#16
cursor[bot] wants to merge 1 commit intoupdatesfrom
typeerror-object-is-7d6amc

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor bot commented Dec 10, 2025

Patch window.wp.richText.split to prevent TypeError when pasting content by ensuring it always returns an iterable array.

The splitValue function in @wordpress/block-editor expects split(value) to return an array of two RichTextValue objects. However, in certain paste scenarios, split can return undefined or a non-array, leading to a TypeError during destructuring. This patch wraps split to normalize its output, guaranteeing a two-item array and preventing the error.


Open in Cursor Open in Web

Co-authored-by: luke <luke@abelltech.com>
@cursor
Copy link
Copy Markdown
Author

cursor bot commented Dec 10, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant