Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build a highlighter #22

Closed
BigBlueHat opened this issue Nov 30, 2017 · 6 comments
Closed

Build a highlighter #22

BigBlueHat opened this issue Nov 30, 2017 · 6 comments
Labels

Comments

@BigBlueHat
Copy link
Member

This does eek into the realm of UX, so I want to proceed cautiously here. However, juggling the "mixed tree" environment discussed in #21 is likely to be a near everyday occurrence for folks building annotation tools.

If we can collectively solve that issue well, we'll all win. 😁

@BigBlueHat
Copy link
Member Author

Additionally, this might help inform things the browsers need to change/tweak/add about how the DOM itself works and interacts.

@Laurian
Copy link

Laurian commented Nov 30, 2017

Many years ago, there was http://xpointerlib.mozdev.org a Firefox add-on used for Annotea, that would insert into DOM elements to highlight annotations, while marking those nodes to be ignored in further operations, such that multiple annotations would still more or less anchor.

See function isMarkedIgnore(element) in https://www.mozdev.org/source/browse/xpointerlib/src/components/nsXPointerService.js?rev=1.21;content-type=text%2Fplain

@tilgovi
Copy link
Contributor

tilgovi commented Dec 1, 2017

Worth taking inspiration from https://github.com/nickstenning/marks too

@tilgovi
Copy link
Contributor

tilgovi commented Dec 1, 2017

Nice part about inserting mark tags is that it's super boring and the browser styles it.

@tilgovi
Copy link
Contributor

tilgovi commented Dec 1, 2017

I take that back. I would rather not commit to any tag choice at all right now and just spend some time mulling over what problem(s) really need solving.

Here are some more formed thoughts that have come up for me in the past:

Q: How to denote things added by the annotation layer
A: TDB, but also maybe just doesn't matter to some selectors

Q: How to visualize style / modify the DOM
A: TDB, but generally requires iterating over the text nodes for text use cases

Q: How do we iterate over all the text nodes?
A: NodeIterator, which I even built a polyfill for: https://github.com/tilgovi/dom-node-iterator

I think we need to sketch a couple highlighter implementations and play with them.

@Treora
Copy link
Contributor

Treora commented Apr 16, 2020

Done in PR 59: #59

@Treora Treora closed this as completed Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants