We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfe6546 commit 6f36f92Copy full SHA for 6f36f92
src/index.js
@@ -46,8 +46,9 @@ function checkReturnForState(editorState, ev) {
46
if (/-list-item$/.test(type) && text === '') {
47
newEditorState = leaveList(editorState);
48
}
49
- if (newEditorState === editorState &&
50
- (ev.ctrlKey || ev.shiftKey || ev.metaKey || ev.altKey || /^header-/.test(type))) {
+ if (newEditorState === editorState
+ && (ev.ctrlKey || ev.shiftKey || ev.metaKey || ev.altKey
51
+ || (/^header-/.test(type) && selection.isCollapsed() && selection.getEndOffset() === text.length))) {
52
newEditorState = insertEmptyBlock(editorState);
53
54
if (newEditorState === editorState && type !== 'code-block' && /^```([\w-]+)?$/.test(text)) {
0 commit comments