Skip to content

Conversation

@nperez0111
Copy link
Contributor

@nperez0111 nperez0111 commented Nov 17, 2025

Summary

There can be invalid textColor or backgroundColor in 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

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

#2176

@vercel
Copy link

vercel bot commented Nov 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
blocknote Ready Ready Preview Nov 17, 2025 0:44am
blocknote-website Ready Ready Preview Nov 17, 2025 0:44am

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 17, 2025

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@2179

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@2179

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@2179

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@2179

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@2179

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@2179

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@2179

@blocknote/xl-ai

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-ai@2179

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@2179

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-email-exporter@2179

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@2179

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@2179

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@2179

commit: 8ce0ba9

@nperez0111 nperez0111 requested a review from YousefED November 17, 2025 12:56
Copy link
Collaborator

@YousefED YousefED left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@nperez0111 nperez0111 merged commit 8fc2370 into main Nov 18, 2025
11 of 12 checks passed
@nperez0111 nperez0111 deleted the fix/2176 branch November 18, 2025 09:37
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.

3 participants