improve type handling for commands

This commit is contained in:
Philipp Kühn
2020-04-21 23:22:27 +02:00
parent 3deae61a15
commit 91d4aa7e39
13 changed files with 45 additions and 35 deletions

View File

@@ -47,8 +47,8 @@ export default class Heading extends Node {
commands(): CommandSpec {
return {
heading: (next, editor, attrs) => {
editor.toggleBlockType(this.type, editor.schema.nodes.paragraph, attrs)
heading: next => attrs => {
this.editor.toggleBlockType(this.type, this.editor.schema.nodes.paragraph, attrs)
next()
},
}