TypeCellOS / TypeCellOS/BlockNote
Typing ``` then Enter throws "Language is not supported" and corrupts cursor/deletion
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 10.2k
- Fork
- 772
- Merge medio
- 3g 11h
- PR unite (30g)
- 17
Descrizione
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 💖
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 70/100