zachlebar/Annotare — comment on commit 37c788f852296a04264466b0a325a4e174b39847
File: SPEC.md line 15
By zachlebar:

When I first started conceptualizing this project, this was the first thing I looked into doing. Because I knew if I couldn't make this work, then I couldn't make any of it work like I wanted to.

This is what I found: http://www.quirksmode.org/dom/range_intro.html. Also take a look here: https://developer.mozilla.org/en/DOM/range.

What I'm envisioning is that through JS we use range to figure out what's being selected, then we wrap that selection in tags with an associated CSS class to style the newly "selected" text like it's been highlighted. Now, undoing this highlight, that might take some more forethought, but at least for right now, we can highlight text on demand, based on the user's selection of the text.