UNPKG
tiptap-utils
Version:
latest (1.13.1)
1.13.1
1.13.0
1.12.0
1.11.0
1.10.4
1.10.3
1.10.1
1.10.0
1.9.1
1.9.0
1.8.4
1.8.3
1.8.2
1.8.1
1.8.0
1.7.0
1.6.1
1.6.0
1.5.8
1.5.7
1.5.6
1.5.5
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.1
1.4.0
1.3.0
1.2.0
1.1.1
1.1.0
1.0.1
1.0.0
0.4.1
0.4.0
0.3.0
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.1
0.1.0
Utility functions for tiptap
tiptap.dev
ueberdosis/tiptap
tiptap-utils
/
src
/
utils
/
markIsActive.js
15 lines
(12 loc)
•
259 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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) }