mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 00:16:59 +00:00
A kind:9802 highlight can carry a huge `context` tag — a quote pulled from the middle of a long article may ship several paragraphs of surrounding text. Rendered whole, that fills the feed card with paragraphs around a one-sentence highlight. Trim the context in `HighlightQuote.of` to at most ~160 characters on each side of the marked quote, snapping the cut to a whole-word boundary and marking it with an ellipsis. The quote itself is always kept in full and the marked range is re-based onto the trimmed text, so the in-context marker still lands exactly on the highlighted passage. Short contexts are left untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ApuEseGcFjUFqYoLhCuR91