Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleClick(view, pos) {
const { schema, doc, tr } = view.state;
const range = getMarkRange(doc.resolve(pos), schema.marks.link);
if (!range) {
return;
}
const $start = doc.resolve(range.from);
const $end = doc.resolve(range.to);
const transaction = tr.setSelection(new TextSelection($start, $end));
view.dispatch(transaction);
}
}