fix blockquote
This commit is contained in:
@@ -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(),
|
||||||
}))
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user