Support code block creation with ```lang + Enter #2443
ysds
started this conversation in
Ideas & Enhancements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
In most Markdown editors, typing
```langand pressing Enter creates a code block. Currently, BlockNote only supports```lang+ Space to trigger code block creation, because ProseMirror input rules only fire on text input (handleTextInput), not on Enter key (handleKeyDown).Expected behavior
Typing
```langfollowed by Enter should create a code block with language, just like```lang+ Space does today.While users could work around this by adding a custom extension with an Enter keyboard shortcut, creating code blocks with
```lang+ Enter is a widely expected Markdown editing convention. Providing this as a built-in behavior improves the out-of-the-box experience and avoids requiring every user to implement the same workaround independently.Additional context
I can submit a PR for this, but it may be related to #2389 and #2345, so holding off for now.
Beta Was this translation helpful? Give feedback.
All reactions