add toggleMark command
This commit is contained in:
9
packages/core/src/utils/getMarkType.ts
Normal file
9
packages/core/src/utils/getMarkType.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { MarkType, Schema } from 'prosemirror-model'
|
||||
|
||||
export default function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType {
|
||||
if (typeof nameOrType === 'string') {
|
||||
return schema.marks[nameOrType]
|
||||
}
|
||||
|
||||
return nameOrType
|
||||
}
|
||||
Reference in New Issue
Block a user