I was working on editing of hyperlinks and made a command that does a removeMark followed by an addMark. For positions of the Selection I use Selection.$from.pos and Selection.$to.pos.
However, in prosemirror-commands I see that the toggleMark function is using Selection.ranges for this. Although I have never seen Selection.ranges.length being more than 1. Is this ever possible for a TextSelection?
It is better to be on the safe side and always use Selection.ranges?