tiptap/packages/core/src/utils/markHasAttributes.ts
2020-10-05 17:12:57 +02:00

10 lines
338 B
TypeScript

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),
)
}