tiptap/packages/extension-list-item/index.ts

20 lines
474 B
TypeScript
Raw Normal View History

2020-09-11 04:29:15 +08:00
import { Node } from '@tiptap/core'
export default new Node()
.name('list_item')
.schema(() => ({
content: 'paragraph block*',
defining: true,
draggable: false,
parseDOM: [
{ tag: 'li' },
],
toDOM: () => ['li', 0],
}))
.keys(({ editor, name }) => ({
2020-09-22 05:44:35 +08:00
// Enter: () => editor.chain().focus().splitListItem(name).run()
2020-09-11 04:29:15 +08:00
// Tab: () => editor.sinkListItem(name),
// 'Shift-Tab': () => editor.liftListItem(name),
}))
.create()