Skip to content

Stop link typing #1114

Answered by Saul-Mirone
SunnyCheung-cp asked this question in Q&A
Sep 6, 2023 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Maybe you can use something like this to check the mark:

function hasMark(state, type) {
  if (!type) return false;
  const { from, $from, to, empty } = state.selection;
  if (empty) return !!type.isInSet(state.storedMarks || $from.marks());
  return state.doc.rangeHasMark(from, to, type);
};

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@SunnyCheung-cp
Comment options

Comment options

You must be logged in to vote
2 replies
@Saul-Mirone
Comment options

Answer selected by SunnyCheung-cp
@SunnyCheung-cp
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants