Skip to content

fix empty paragraphs appearing on block level deletions#31

Open
samik-bind wants to merge 3 commits intohandlewithcarecollective:mainfrom
samik-bind:fix/cross-block-deletion-empty-paragraphs
Open

fix empty paragraphs appearing on block level deletions#31
samik-bind wants to merge 3 commits intohandlewithcarecollective:mainfrom
samik-bind:fix/cross-block-deletion-empty-paragraphs

Conversation

@samik-bind
Copy link

@samik-bind samik-bind commented Feb 9, 2026

Cross-block deletions (e.g. selecting across list items + paragraph and deleting) produced extra empty paragraphs with ZWS insertion marks. This happened because suggestReplaceStep treated purely structural joining slices (empty paragraph tokens with no text) as content to insert.

The fix skips the insertion path when the slice has no text content and there's a deletion range (from !== to), so structural joining tokens are no longer materialized as visible empty paragraphs.

@samik-bind
Copy link
Author

Easiest way to see this bug is just go to the demo, and delete content from the last paragraph all the way to the start of the list, for example:
image

And with the fix:

image

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