[These links will stop working by July 2014.]
The now-dead Readmill *kinda* did this. Not really. OK. Not at all.
Here's an example:
The way Readmill stored the location of highlights is implied here:
You'll see a "position: 0.25" in there. That's actually the *percentage* of the book near where the quote appears. See, Readmill tried very hard to merge down multiple renditions of the same book into one master work (if you know FRBR, they attempted to take all the various Manifestations of a Work's Expression and merge them together, or: they attempted to take all the various releases, re-releases, ISBNs, digital formats of the A Game of Thrones "novel" and merge them down into one "book"), so that the community would be sharing one master-read together. For example, lots of different Manifestations of
https://readmill.com/books/a-game-of-thrones were merged together to create that master display of shared community highlights. I *think* this is an improvement on how Kindle does it, where the locations are much more tied toward the particular Manifestation you're reading. It is also much more forgiving for "ebook version 2.1" or "with author commentary!" re-releases/updates.
The interesting thing is there's some magical Readmill code that takes the highlight and position and magically makes it possible to see it in inline when you're reading the book, even if you're reading a different Manifestation of the original highlighter's. I suspect they're taking the percentage of the highlight, searching to that point in the current ebook, adding/minusing 5%, and then searching for the highlighted bit of text (or, at least, that would be MY first stab at an implementation). This would potentially fail on rather short highlights (such as "She died", which would be disastrous if the app linked to a spoiled "She died for real this time" vs. an earlier "She died laughing.") but for longer highlights, such as the one above, would probably work pretty well.