Skip to content

BNSplitBlock fix #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 8, 2023
Merged

BNSplitBlock fix #72

merged 8 commits into from
Feb 8, 2023

Conversation

matthewlipski
Copy link
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
Copy link

vercel bot commented Dec 9, 2022

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
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
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