mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
A kind:9802 highlight with no `context` tag falls back to reconstructing the surrounding passage from the W3C `textquoteselector` prefix/suffix. Those fragments are scraped from the source web page, so they carry the page's block-boundary whitespace (runs of newlines/spaces between DOM nodes). Glued in verbatim as `prefix + content + suffix`, they render as a stack of blank lines above the marked quote. Collapse each whitespace run in the prefix/suffix to a single space (and trim the outer edges) in `HighlightEvent.contextOrReconstructed()`. The highlight's own `content` is left verbatim so its offsets inside the reconstructed context stay exact for the in-context marker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ApuEseGcFjUFqYoLhCuR91