TypeCellOS / TypeCellOS/BlockNote
Typing ``` then Enter throws "Language is not supported" and corrupts cursor/deletion
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 10.2k
- Forks
- 772
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 17
Description
What’s broken?
Typing ``` (with no language name) and pressing Enter creates a code block whose language is an empty string. The highlighter then throws Uncaught Error: Language is not supported. After that, the cursor position is wrong, and Backspace/Delete no longer behave correctly in that block.
What did you expect to happen?
Typing ``` and pressing Enter should create a normal code block with the default language (e.g. text), without throwing. The cursor should land inside the block, and Backspace/Delete should work as usual.
Steps to reproduce
- Open any BlockNote editor with
@blocknote/code-blockenabled (the official code-block example is enough). - In an empty paragraph, type ``` (three backticks, no language name).
- Press Enter.
Result: the console throws Uncaught Error: Language is not supported. After that, the cursor is in the wrong place, and Backspace/Delete in that block are also wrong.
```js then Enter does not reproduce this.
BlockNote version
v0.54.0
Environment
No response
Additional context
No response
Contribution
- I'd be interested in contributing a fix for this issue
Sponsor
- I'm a sponsor and would appreciate if you could look into this sooner than later 💖
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.
Research direction
Start with the @blocknote/code-block entry point and reproduce the issue in the official code-block example using ``` followed by Enter. Trace how an empty language is handled, then verify that the block uses a default language, no error occurs, the cursor lands inside it, and Backspace/Delete behave normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100