tiptap/packages/core/src/utils/markHasAttributes.ts

10 lines
343 B
TypeScript
Raw Normal View History

2020-10-05 23:12:57 +08:00
import { EditorState } from 'prosemirror-state'
import { MarkType } from 'prosemirror-model'
import getMarkAttrs from './getMarkAttrs'
export default function markHasAttributes(state: EditorState, type: MarkType, attrs?: Object) {
2020-10-05 23:26:34 +08:00
return attrs === undefined || JSON.stringify(attrs) === JSON.stringify(
2020-10-05 23:12:57 +08:00
getMarkAttrs(state, type),
)
}