Verify that no pathspans partially overlap. IOW either span A is a child of span B, or a parent of span B, or a sibling of span B, or a parent or child of sibling of span B`
Verify that a given text selection resolves to one path from all the path spans (see the visualizer for how to do this.)
On further consideration, neither of these are necessary. Because of the way the path spans are constructed, it is impossible for either of these scenarios to ever happen.
A
is a child of spanB
, or a parent of spanB
, or a sibling of spanB
, or a parent or child of sibling of span B`