Treora commented on issue #111: URL: https://github.com/apache/incubator-annotator/issues/111#issuecomment-868328208
Hi David, this indeed happens because we recently changed the API for CssSelectors. My reasoning was that the target of a CssSelector will always be an Element (or multiple), so returning that element may be more natural, and more practical especially for people that only use the CssSelector and not others. On the other hand, it makes that not every matcher function returns the same type of match. The change went together with making every matcher function accept either a Range or an Element for their `scope` argument (instead of just a Range), so that you can still e.g. refine a CssSelector with a TextQuoteSelector (i.e. the CssSelector’s matching element(s) is the scope within which the quote will be searched). You make me realise that we should then also change `highlightRange` to accept an Element too (and rename it accordingly). Your thoughts on these API changes are very welcome; we need more user feedback to learn what works for people. Perhaps we could make more breaking changes to elicit such responses. ;) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org