fix blockquote

This commit is contained in:
Philipp Kühn
2020-09-22 09:15:04 +02:00
parent dcac67c61a
commit 80c2d2681e

View File

@@ -1,9 +1,11 @@
import { Node } from '@tiptap/core'
import { Command, Node } from '@tiptap/core'
import { textblockTypeInputRule } from 'prosemirror-inputrules'
export type BlockquoteCommand = () => Command
declare module '@tiptap/core/src/Editor' {
interface Editor {
blockquote(): Editor,
blockquote: BlockquoteCommand,
}
}
@@ -21,12 +23,11 @@ export default new Node()
],
toDOM: () => ['blockquote', 0],
}))
// .commands(({ editor, name }) => ({
// [name]: next => attrs => {
// editor.toggleNode(name, 'paragraph', attrs)
// next()
// },
// }))
.commands(({ name }) => ({
[name]: attrs => ({ commands }) => {
return commands.toggleNode(name, 'paragraph', attrs)
},
}))
.keys(({ editor }) => ({
'Shift-Mod-9': () => editor.blockquote(),
}))