add toggleMark command

This commit is contained in:
Philipp Kühn
2020-04-22 14:06:15 +02:00
parent 0e18e67c93
commit 4e6404a404
7 changed files with 57 additions and 14 deletions

View File

@@ -1,5 +1,4 @@
import { Mark, CommandSpec, markInputRule, markPasteRule } from '@tiptap/core'
import { toggleMark } from 'prosemirror-commands'
import { MarkSpec } from 'prosemirror-model'
import VerEx from 'verbal-expressions'
@@ -34,8 +33,8 @@ export default class Bold extends Mark {
commands(): CommandSpec {
return {
bold: (next, { view }) => () => {
toggleMark(this.type)(view.state, view.dispatch)
bold: next => () => {
this.editor.toggleMark(this.name)
next()
},
}