Skip to content

fix(code-block): handle unknown languages better #1626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025

Conversation

nperez0111
Copy link
Contributor

@nperez0111 nperez0111 commented Apr 22, 2025

This resolves a bug where if a language is a language that is not within supportedLanguages, it would throw an error rather than silently letting you continue to use it as a plaintext code block

Sentry bug: https://blocknote-js.sentry.io/issues/37666656/?environment=vercel-production&project=4508925646078032&query=is%3Aunresolved%20issue.priority%3A%5Bhigh%2C%20medium%5D&referrer=issue-stream&stream_index=24

Copy link

vercel bot commented Apr 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Apr 22, 2025 11:40am
blocknote-website ✅ Ready (Inspect) Visit Preview Apr 22, 2025 11:40am

Copy link

pkg-pr-new bot commented Apr 22, 2025

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/ariakit@1626

@blocknote/code-block

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/code-block@1626

@blocknote/core

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/core@1626

@blocknote/mantine

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/mantine@1626

@blocknote/server-util

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/server-util@1626

@blocknote/react

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/react@1626

@blocknote/shadcn

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/shadcn@1626

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-docx-exporter@1626

@blocknote/xl-multi-column

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-multi-column@1626

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-odt-exporter@1626

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/TypeCellOS/BlockNote/@blocknote/xl-pdf-exporter@1626

commit: fda9505

Copy link
Collaborator

@YousefED YousefED left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. does it make sense to log a warning? it's a bit suspicious when a block has a language that doesn't have a highlighter, right?

@nperez0111
Copy link
Contributor Author

nice. does it make sense to log a warning? it's a bit suspicious when a block has a language that doesn't have a highlighter, right?

The user can add a block like that by typing ```anytext

So, I don't think it is on the dev at that point. I like the fallback to no highlighting at all

@nperez0111 nperez0111 merged commit 8a37698 into main Apr 23, 2025
12 checks passed
@nperez0111 nperez0111 deleted the code-block-supported-langs branch April 23, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants