add commands and utils packages
This commit is contained in:
14
packages/tiptap-utils/src/utils/markIsActive.js
Normal file
14
packages/tiptap-utils/src/utils/markIsActive.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export default function (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)
|
||||
}
|
||||
Reference in New Issue
Block a user