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

Đang mở
#2,181 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 💖
Ngôn ngữ chính
TypeScript
Star
10.2k
Fork
772
Merge trung bình
3 ngày 11 giờ
Pull request đã merge (30 ngày)
17

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TypeCellOS/BlockNote

Tất cả issue của TypeCellOS/BlockNote

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.