What’s the best way to, given a selection, a) find out if a given mark applies to all inline content in the selection, and b) if it does, expand the selection to the beginning and end of the content contiguously having that mark?
That is to say, if I have the text:
Colorless green ideas sleep furiously.
And I put my cursor between the e’s in “sleep”, how could I programmatically get the whole link?
I have a custom mark that’s semantically similar to a hyperlink, and I want to provide UI for changing the target. It doesn’t make sense to update the target for a substring in the middle of a link. I want to be able to change the target of the whole link.