3 ms·
Cool! How does it identify elements to anchor to, and what happens when the original text changes?
by o_____________o 4y ago
Cool!
How does it identify elements to anchor to, and what happens when the original text changes?
- ritinkar 4y agoIf you're asking how the "Highlights" feature works, its using something called text fragments. When the original text changes then the highlight is dead. Meaning you can still discuss it, but it will no longer be highlighted in the window. You can read more about text fragments here - https://web.dev/text-fragments/ https://web.dev/text-fragments/
- o_____________o 4y agoThat seems like it would be a problem for something like a documentation site, where even small changes to the text would break the entire highlight. Maybe you can implement something via diff to maintain a fuzzier anchor.