On Fri, Jun 14, 2019, 09:29 Randall Leeds <rand...@apache.org> wrote:
> The API on master here currently separates the parse operation that takes > a selector string/object, returning a scoped match function. This provides > an opportunity to close over shared state held by the parser/constructor. > > The parse step does not initially scope the selector to any context. It's > not possible to know, until the match function is invoked, that multiple > selectors are applicable to the same scope. I suspect this concern can be > lifted by binding the parser to a root scope. Therefore, I don't think > there's any action here, but I figured I'd mention it. > For reference, here's the current TextQuoteSelector: https://github.com/apache/incubator-annotator/blob/da7c578d3030a2374a374707f3f2d86f6b745669/packages/text/src/index.js Note that there is no approximate matching implemented. It is implemented in terms on strings only and not text nodes. I've been trying to decide how to bridge between context formats like DOM nodes, ranges, and strings. I like your string normalization step. I think it could also address unicode code point vs code unit.