add heading command

This commit is contained in:
Philipp Kühn
2020-04-21 22:36:31 +02:00
parent a057755e42
commit 6b5b30f3fc
4 changed files with 45 additions and 8 deletions

View File

@@ -43,13 +43,13 @@ export default class Heading extends Node {
}
}
// commands(): CommandSpec {
// return {
// heading: (next, { view }) => {
// toggleBlockType(this.type)(view.state, view.dispatch)
// next()
// },
// }
// }
commands(): CommandSpec {
return {
heading: (next, editor, attrs) => {
editor.toggleBlockType(this.type, editor.schema.nodes.paragraph, attrs)
next()
},
}
}
}