BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

What to do with "unknown colors" showing up from external HTML

Open nperez0111 opened this issue 3 months ago • 0 comments

Describe the bug

When pasting in external HTML (or setting it via an initial document JSON). There can be textColor or backgroundColor which is a value other than the color names which we already support (e.g. red, blue, etc).

This is originally found to be an issue with this PR: https://github.com/TypeCellOS/BlockNote/pull/2179

To Reproduce

initialContent={ [ { type: "paragraph", props: { textColor: "rgba(0, 0, 0, 0.5)" } } ] }

By explicitly setting the textColor to an invalid value, it is preserved in the document when it should likely be stripped as invalid? Perhaps the zod props parsing introduced by https://github.com/TypeCellOS/BlockNote/pull/2096 will resolve this issue?

Misc

  • Node version: N/A
  • Package manager: N/A
  • Browser: N/A
  • [ ] I'm a sponsor and would appreciate if you could look into this sooner than later 💖

nperez0111 avatar Nov 18 '25 09:11 nperez0111