add blockquote commands

This commit is contained in:
Philipp Kühn
2020-11-18 11:54:18 +01:00
parent 3f624845e8
commit 012beb286c
9 changed files with 63 additions and 9 deletions

View File

@@ -34,18 +34,30 @@ const Blockquote = Node.create({
addCommands() {
return {
/**
* Set a blockquote node
*/
setBlockquote: (): Command => ({ commands }) => {
return commands.wrapIn('blockquote')
},
/**
* Toggle a blockquote node
*/
blockquote: (): Command => ({ commands }) => {
toggleBlockquote: (): Command => ({ commands }) => {
return commands.toggleWrap('blockquote')
},
/**
* Unset a blockquote node
*/
unsetBlockquote: (): Command => ({ commands }) => {
return commands.lift('blockquote')
},
}
},
addKeyboardShortcuts() {
return {
'Shift-Mod-9': () => this.editor.commands.blockquote(),
'Shift-Mod-9': () => this.editor.commands.toggleBlockquote(),
}
},