From d97b405caecd737a7ce281bd624afc538b2665ef Mon Sep 17 00:00:00 2001 From: svatantrya Date: Sun, 5 Jul 2026 21:47:23 -0400 Subject: [PATCH] truncate long URLs in server list to 40 chars with ellipsis --- index.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 4d20a04..c644715 100644 --- a/index.html +++ b/index.html @@ -361,6 +361,7 @@ let withTor = true, q = ""; let minAmount = 50000; const fmt = n => (n != null ? Number(n).toLocaleString('en-US') : '—'); +const trunc = (s, m=40) => s && s.length > m ? s.slice(0, m) + '…' : s; function getChain() { const btn = document.querySelector('#chainSeg [aria-pressed="true"]'); @@ -391,7 +392,7 @@ function render() { tb.insertAdjacentHTML('beforeend', ` ${rank} - ${DOMPurify.sanitize(d.url)} + ${DOMPurify.sanitize(trunc(d.url))} ${DOMPurify.sanitize(d.info||'—')} ${fmt(d.base_fee)} ${DOMPurify.sanitize(d.version||'—')} @@ -404,7 +405,7 @@ function render() { ml.insertAdjacentHTML('beforeend', `
Score${fmt(d.points)}