Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 40e789d

Browse files
committed
Fix blockquote exiting behaviour
Before this change, exiting a blockquote required users to press `SHIFT+ENTER`. That was unexpected behaviour, as in pure markdown blockquotes stop at a new line. After this change, blockquotes behave like headings: When `ENTER` is pressed a new empty block is inserted. This is more expected, and to continue making blockquotes one can continue inserting `>` at the beginning of lines.
1 parent bfe6546 commit 40e789d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function checkReturnForState(editorState, ev) {
4747
newEditorState = leaveList(editorState);
4848
}
4949
if (newEditorState === editorState &&
50-
(ev.ctrlKey || ev.shiftKey || ev.metaKey || ev.altKey || /^header-/.test(type))) {
50+
(ev.ctrlKey || ev.shiftKey || ev.metaKey || ev.altKey || /^header-/.test(type) || type === 'blockquote')) {
5151
newEditorState = insertEmptyBlock(editorState);
5252
}
5353
if (newEditorState === editorState && type !== 'code-block' && /^```([\w-]+)?$/.test(text)) {

0 commit comments

Comments
 (0)