fix: cut public shared highlights to 100 words or 600 characters by gnapse · Pull Request #155 · klipstack/klipstack · GitHub
Skip to content

fix: cut public shared highlights to 100 words or 600 characters - #155

Merged
gnapse merged 3 commits into
mainfrom
fix/cap-shared-highlight-quotes
Oct 21, 2026
Merged

gnapse merged 3 commits into
mainfrom
fix/cap-shared-highlight-quotes

Conversation

@gnapse

@gnapse gnapse commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Why

A shared highlight's public page (/h/…) showed the whole highlight, up to 20,000 characters, and its note, up to 10,000. That could republish most of an article, against the terms' promise that public pages only quote short passages.

What changes

  • The public page, its link-preview picture and its report page show at most 100 words or 600 characters of the quote, and the same of the note, ending in "…". People can still share highlights of any length.
  • The cut happens when the page is read (getPublicShare), not when it is saved: shares made before this are cut too, and the stored snapshot keeps the full text, so the owner's "changed since shared" check still works.
  • The note is measured as it reads (a link by its title), and a link the cut falls inside is left out whole.
  • Text without spaces, or one very long word, is cut at 600 characters.
  • The quote now keeps its paragraph breaks. The page's line clamps are gone: they no longer guard length, and would hide lines of a short poem.

Verification

  • New tests on the page's loader: the cut at word 100 and at 600 characters, text without spaces, paragraph breaks kept, the owner's full text, note links kept or dropped, line breaks counted in notes. They failed before the change, and breaking the note's line-break count or link handling makes them fail.
  • pnpm verify, e2e/share-links.spec.ts, and a long share checked in the browser.

Risk and follow-ups

  • Admins reviewing a report still see the full stored quote.
  • Lowering the 10,000-character limit on highlight notes themselves is left for a separate change: it touches the API contract and the iPhone app.

@gnapse
gnapse enabled auto-merge (squash) October 21, 2026 21:03
@gnapse
gnapse merged commit 684fb43 into main Oct 21, 2026
10 checks passed
@gnapse
gnapse deleted the fix/cap-shared-highlight-quotes branch October 21, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant