diff --git a/src/utils/prosemirror/plugins/keymap.ts b/src/utils/prosemirror/plugins/keymap.ts index 0ad7ce9a..1978249b 100644 --- a/src/utils/prosemirror/plugins/keymap.ts +++ b/src/utils/prosemirror/plugins/keymap.ts @@ -9,6 +9,9 @@ import { joinUp, joinDown, chainCommands, + newlineInCode, + createParagraphNear, + liftEmptyBlock, splitBlockKeepMarks, } from 'prosemirror-commands' @@ -26,7 +29,13 @@ export const buildKeymap = (schema: Schema) => { bind('Ctrl-i', toggleMark(schema.marks.em)) bind('Ctrl-u', toggleMark(schema.marks.underline)) bind('Ctrl-d', toggleMark(schema.marks.strikethrough)) - bind('Enter', chainCommands(splitListItem(schema.nodes.list_item), splitBlockKeepMarks)) + bind('Enter', chainCommands( + splitListItem(schema.nodes.list_item), + newlineInCode, + createParagraphNear, + liftEmptyBlock, + splitBlockKeepMarks, + )) bind('Mod-[', liftListItem(schema.nodes.list_item)) bind('Mod-]', sinkListItem(schema.nodes.list_item))