UNPKG

tiptap-utils

Version:

Utility functions for tiptap

15 lines (12 loc) 259 B
export default function markIsActive(state, type) { const { from, $from, to, empty, } = state.selection if (empty) { return !!type.isInSet(state.storedMarks || $from.marks()) } return !!state.doc.rangeHasMark(from, to, type) }