Skip to content

BNSplitBlock fix#72

Merged
matthewlipski merged 8 commits into
mainfrom
split_block_fix
Feb 8, 2023
Merged

BNSplitBlock fix#72
matthewlipski merged 8 commits into
mainfrom
split_block_fix

Conversation

@matthewlipski

Copy link
Copy Markdown
Collaborator

Since the BNSplitBlock function only copies text content to the new block, if the block being split has nested blocks, they aren't preserved and their text is just concatenated together. This PR fixes the issue, and now uses Split objects to replace content in both the original and new block, whereas before they were only used for the original block.

@vercel

vercel Bot commented Dec 9, 2022

Copy link
Copy Markdown

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

Name Status Preview Comments Updated
blocknote ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 8, 2023 at 4:03PM (UTC)

@YousefED

Copy link
Copy Markdown
Collaborator

Nice, is there a test for this as well?

# Conflicts:
#	packages/core/src/extensions/Blocks/nodes/BlockContainer.ts
@matthewlipski matthewlipski merged commit e35f026 into main Feb 8, 2023
fogle pushed a commit to fogle/BlockNote that referenced this pull request May 20, 2023
* Fixed block splitting bug

* Rewrite to use `Slice` instead of `textContent` for block content

* Minor changes

* Added related keyboard handler tests

* Updated Chromium snapshot

* Increased test timeout
@nperez0111 nperez0111 deleted the split_block_fix branch October 21, 2025 07:32
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.

2 participants