fix: do not error on invalid backgroundColor or textColor #2176#2179
Merged
nperez0111 merged 1 commit intomainfrom Nov 18, 2025
Merged
fix: do not error on invalid backgroundColor or textColor #2176#2179nperez0111 merged 1 commit intomainfrom
nperez0111 merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@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: |
YousefED
approved these changes
Nov 18, 2025
Collaborator
YousefED
left a comment
There was a problem hiding this comment.
ok for now, can you create a follow up ticket to investigate the root cause? (e.g.: how should we handle color pasting from external html
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
There can be invalid
textColororbackgroundColorin a document. We were assuming that it always was a valid color. This changes all of the places where we read the backgroundColor or textColor to not make that assumption & access a property which does not actually exist.There is some digging to be done here to understand whether we can prevent these invalid values from getting within the document, but at this point I think having this defensive code is still needed as I'm unsure that we can actually fully validate these string attributes in prosemirror.
Perhaps this is helped with the zod props, so this may not be required soon.
Rationale
Changes
Impact
Testing
Screenshots/Video
Checklist
Additional Notes
#2176