Is it not possible to insert a mark instead of a node using tr.replaceWith() ?
I’m replacing a substring of text from pos - href.length + 1 where pos is the current selection / cursor position to pos
it’s not working
dispatch(tr.replaceWith( pos - href.length + 1, pos, marks.link.create({ href }) ));
The text in the specified range will vanish but the mark won’t be inserted