Hard-cap list view description snippet at 180 chars
line-clamp wasn't clamping reliably; truncate in JS instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,11 +6,12 @@ import { createDownload, toggleQueue, toggleLike, dismissDiscovery, getSettings
|
||||
|
||||
function snippetText(desc) {
|
||||
if (!desc) return "";
|
||||
return desc
|
||||
.replace(/https?:\/\/\S+/g, "") // strip URLs
|
||||
.replace(/\n+/g, " ") // flatten newlines
|
||||
.replace(/\s{2,}/g, " ") // collapse whitespace
|
||||
const s = desc
|
||||
.replace(/https?:\/\/\S+/g, "")
|
||||
.replace(/\n+/g, " ")
|
||||
.replace(/\s{2,}/g, " ")
|
||||
.trim();
|
||||
return s.length > 180 ? s.slice(0, 180).trimEnd() + "…" : s;
|
||||
}
|
||||
|
||||
function formatDuration(secs) {
|
||||
|
||||
Reference in New Issue
Block a user