TypeCellOS / BlockNote

A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
https://www.blocknotejs.org/
Mozilla Public License 2.0
5.89k stars 381 forks source link

fix: Copy selection starting in nested block #870

Closed matthewlipski closed 3 hours ago

matthewlipski commented 5 days ago

It's possible to select & copy nested blocks without content from the parent block being selected. ProseMirror still tries to preserve the nesting structure in this case, but because content from the parent block is not selected, it basically violates the schema when creating the Fragment for the selected content. I documented this pretty extensively in the code so recommend checking that out for more details.

vercel[bot] commented 5 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Jun 28, 2024 3:34pm
blocknote-website ✅ Ready (Inspect) Visit Preview Jun 28, 2024 3:34pm
matthewlipski commented 4 days ago

Nice, and clear comments. Should we specifically also test the use-case from the bug report, which is about list structures? Or does the fact that it's a list not really matter?

Nah the list items are totally irrelevant here, I think they got specifically reported just because nesting list items is a much more common use case than nesting other types of blocks.