TypeCellOS / TypeCellOS/BlockNote
Typing ``` then Enter throws "Language is not supported" and corrupts cursor/deletion
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 10.2k
- Forks
- 772
- Ø Merge
- 3 T. 11 Std.
- Gemergte PRs (30 T.)
- 17
Beschreibung
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 💖
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 70/100