Remove mark a cursor is within

I am trying to add a “Remove link” feature to my application. I want it to work by allowing the user to press the remove button when their selection is within the link, and have the link be deleted. Unfortunately I can not find a way of doing this. I can not find a way of getting the start and end position for the text nodes to make this happen with removeMark. Is there another way?

Ended up solving this with findChildrenByMark in https://github.com/atlassian/prosemirror-utils This returns the actually text node and from there I got the position.

1 Like