add some more commands

This commit is contained in:
Philipp Kühn
2020-09-21 23:17:30 +02:00
parent 778e064979
commit 4da71ecfbb
27 changed files with 207 additions and 210 deletions

View File

@@ -1,8 +1,10 @@
import { Mark } from '@tiptap/core'
import { Command, Mark } from '@tiptap/core'
export type UnderlineCommand = () => Command
declare module '@tiptap/core/src/Editor' {
interface Editor {
underline(): Editor,
underline: UnderlineCommand,
}
}
@@ -21,9 +23,8 @@ export default new Mark()
toDOM: () => ['u', 0],
}))
.commands(({ editor, name }) => ({
underline: next => () => {
editor.toggleMark(name)
next()
underline: () => ({ commands }) => {
return commands.toggleMark(name)
},
}))
.keys(({ editor }) => ({