-
-
Notifications
You must be signed in to change notification settings - Fork 638
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When we copy a text that has a style attach, and paste it in the doc, the export will then fails (pdf / odt / docx..).
How to reproduce
- Copy any text from github
- Paste it to a doc
- Export
- The export fails
Why
A paste color can be in rgb:
Problem location
BlockNote/packages/xl-pdf-exporter/src/pdf/pdfExporter.tsx
Lines 299 to 301 in d192b37
| : this.options.colors[ | |
| props.backgroundColor as keyof typeof this.options.colors | |
| ].background, |
BlockNote/packages/xl-pdf-exporter/src/pdf/pdfExporter.tsx
Lines 305 to 307 in d192b37
| : this.options.colors[ | |
| props.textColor as keyof typeof this.options.colors | |
| ].text, |
The array is possibly undefined, it should be something like:
this.options.colors?.[props.backgroundColor as keyof typeof this.options.colors]?.background
https://github.com/search?q=repo%3ATypeCellOS%2FBlockNote%20props.textColor%20as&type=code
Misc
- Node version:
- Package manager:
- Browser:
- I'm a sponsor and would appreciate if you could look into this sooner than later 💖
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working