check if mark has attributes
This commit is contained in:
9
packages/core/src/utils/markHasAttributes.ts
Normal file
9
packages/core/src/utils/markHasAttributes.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { EditorState } from 'prosemirror-state'
|
||||
import { MarkType } from 'prosemirror-model'
|
||||
import getMarkAttrs from './getMarkAttrs'
|
||||
|
||||
export default function markHasAttributes(state: EditorState, type: MarkType, attrs?: Object) {
|
||||
return attrs === null || JSON.stringify(attrs) === JSON.stringify(
|
||||
getMarkAttrs(state, type),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user