Skip to content

fix(blocks): keep a default Block after rendering empty HTML - #3078

Open
Anurag-S1ngh wants to merge 1 commit into
codex-team:nextfrom
Anurag-S1ngh:fix/1985-renderfromhtml-empty
Open

Anurag-S1ngh wants to merge 1 commit into
codex-team:nextfrom
Anurag-S1ngh:fix/1985-renderfromhtml-empty

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown
Contributor

Summary

Calling blocks.renderFromHTML() with an empty string or blank HTML cleared all blocks and left the editor with no Block. Clicking the holder afterward hit code that expected a current Block and threw Cannot read properties of undefined (reading 'holder').

The method now inserts a default Block when processing leaves the editor empty.

Changes

  • Await Paste.processText() and insert a default Block if no Blocks were created.
  • Add Cypress coverage for an empty string and HTML with no content.

Testing

  • yarn lint
  • yarn test:e2e (391 passing)

Closes #1985

@Anurag-S1ngh
Anurag-S1ngh requested a review from neSpecc as a code owner December 2, 2026 16:19

This branch has not been deployed

No deployments
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.

calling renderFromHTML with empty string or blank tags causes crash when you click on the editor holder

1 participant