move commands again
This commit is contained in:
10
packages/core/src/commands/toggleMark.ts
Normal file
10
packages/core/src/commands/toggleMark.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { toggleMark as originalToggleMark } from 'prosemirror-commands'
|
||||
import { MarkType } from 'prosemirror-model'
|
||||
import { Command } from '../Editor'
|
||||
import getMarkType from '../utils/getMarkType'
|
||||
|
||||
export default (typeOrName: string | MarkType): Command => ({ state, dispatch }) => {
|
||||
const type = getMarkType(typeOrName, state.schema)
|
||||
|
||||
return originalToggleMark(type)(state, dispatch)
|
||||
}
|
||||
Reference in New Issue
Block a user