What to do with "unknown colors" showing up from external HTML
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Reproduce the initialContent example and trace the block property validation path, including the Zod props parsing introduced by PR #2096 and the external HTML path from PR #2179. Add a focused regression test for unsupported textColor and backgroundColor values; the issue is done when the chosen validation behavior is consistent for both input paths.
Written by the indexing model from the issue text.
Description
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 💖
- Dominant language
- TypeScript
- Stars
- 10.2k
- Forks
- 772
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TypeCellOS/BlockNote
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
TypeCellOS/BlockNote#3098 ·
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
TypeCellOS/BlockNote#3073 ·
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
TypeCellOS/BlockNote#3072 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
TypeCellOS/BlockNote#2949 · 1 comment ·
-
a11y
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
TypeCellOS/BlockNote#2855 ·
All issues in TypeCellOS/BlockNote
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·