perf: 文本框优化

This commit is contained in:
pipipi-pikachu 2023-02-03 21:18:01 +08:00
parent 62289a87db
commit 7bcbae1782

View File

@ -8,6 +8,8 @@ import {
selectParentNode,
joinUp,
joinDown,
chainCommands,
splitBlockKeepMarks,
} from 'prosemirror-commands'
export const buildKeymap = (schema: Schema) => {
@ -24,8 +26,7 @@ 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', splitListItem(schema.nodes.list_item))
bind('Enter', chainCommands(splitListItem(schema.nodes.list_item), splitBlockKeepMarks))
bind('Mod-[', liftListItem(schema.nodes.list_item))
bind('Mod-]', sinkListItem(schema.nodes.list_item))