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