fix: add more lenient parsing for code blocks, to accept newlines #2105#2108
Merged
nperez0111 merged 2 commits intomainfrom Oct 27, 2025
Merged
fix: add more lenient parsing for code blocks, to accept newlines #2105#2108nperez0111 merged 2 commits intomainfrom
nperez0111 merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 task
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
Collaborator
|
Alright I think a single test case to cover multi-line The one thing I was hesitant about was that blocks generally mark newlines with a line break node, but the parsed code block content is just one big multi-line string. But then I saw that it's because of the |
matthewlipski
approved these changes
Oct 24, 2025
Collaborator
matthewlipski
left a comment
There was a problem hiding this comment.
@nperez0111 do you want me to add tests for this or are you good? Also
Contributor
Author
|
I think this is sufficient, thanks @matthewlipski |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I only validated that this did what I expected, I do not think that this is actually complete, we should add tests for this specific behavior.
Closes #2105
Rationale
This allows us to more leniently parse existing code blocks from arbitrary HTML in a way which is more user-friendly.
Changes
Impact
Testing
Screenshots/Video
Checklist
Additional Notes