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

Aperta
#2,181 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug:P4

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 💖
Lingua principale
TypeScript
Stelle
10.2k
Fork
772
Merge medio
3g 11h
PR unite (30g)
17

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di TypeCellOS/BlockNote

Tutte le issue di TypeCellOS/BlockNote

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.