fix toggle blockquotes

This commit is contained in:
Philipp Kühn
2018-10-10 15:08:37 +02:00
parent 27fa310937
commit fe210f68ed
3 changed files with 22 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
import { Node, Plugin } from 'tiptap'
import { wrappingInputRule, wrapIn } from 'tiptap-commands'
import { Node } from 'tiptap'
import { wrappingInputRule, toggleWrap } from 'tiptap-commands'
export default class BlockquoteNode extends Node {
@@ -9,7 +9,7 @@ export default class BlockquoteNode extends Node {
get schema() {
return {
content: 'block+',
content: 'block*',
group: 'block',
defining: true,
draggable: false,
@@ -20,13 +20,13 @@ export default class BlockquoteNode extends Node {
}
}
command({ type }) {
return wrapIn(type)
command({ type, schema }) {
return toggleWrap(type, schema.nodes.paragraph)
}
keys({ type }) {
return {
'Ctrl->': wrapIn(type),
'Ctrl->': toggleWrap(type),
}
}