mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-22 16:17:50 +08:00
20 lines
453 B
TypeScript
20 lines
453 B
TypeScript
|
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 }) => ({
|
||
|
// Enter: () => editor.splitListItem(name),
|
||
|
// Tab: () => editor.sinkListItem(name),
|
||
|
// 'Shift-Tab': () => editor.liftListItem(name),
|
||
|
}))
|
||
|
.create()
|