Changeset 2f50c53 in Klonkt
- Timestamp:
- 07/01/2026 12:00:33 AM (2 months ago)
- Branches:
- main
- Children:
- 4e9782c
- Parents:
- 366c13c
- File:
-
- 1 edited
-
src/routes/circle.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/circle.js
r366c13c r2f50c53 32 32 return String(html || '').replace(/<[^>]+>/g, ' ').replace(/&[a-z#0-9]+;/gi, ' ').replace(/\s+/g, ' ').trim(); 33 33 } 34 // Tidy a plain-text snippet for use as a card title: drop a leading "RE: <url>" (the 35 // quote/reply prefix Misskey/Akkoma and some reply federation prepend) and any other 36 // leading bare URL, so the title shows the actual prose, not link noise. 37 function tidySnippet(text) { 38 return String(text || '') 39 .replace(/^RE:\s*https?:\/\/\S+\s*/i, '') 40 .replace(/^https?:\/\/\S+\s*/i, '') 41 .trim(); 42 } 34 43 35 44 router.get('/cirkel', (req, res, next) => { … … 38 47 39 48 const posts = ActivityPubService.getCirkelPosts(site.slug, 80).map((r) => { 40 const text = htmlToText(r.content);49 const text = tidySnippet(htmlToText(r.content)); 41 50 // Show ONLY the title (the bold first line a Klonkt note carries), not the whole 42 51 // body. Title-less notes (e.g. plain Mastodon) fall back to a short text snippet.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)