fix: 文本框无法退出列表格式

This commit is contained in:
pipipi-pikachu 2023-02-11 15:25:50 +08:00
parent 7bcbae1782
commit 98996034fe

View File

@ -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))