diff --git a/public/assets/presentation.js b/public/assets/presentation.js index 54d34e0..72a1651 100644 --- a/public/assets/presentation.js +++ b/public/assets/presentation.js @@ -43,7 +43,9 @@ const tok = ref || (sp && sp.ref) || ''; if (sp && sp.name && tok && !sp.own) { $('prHead').innerHTML = 'Shared with you by ' + esc(sp.name) + ''; - $('prText').textContent = sp.bio ? sp.bio : 'They can help you get set up in a few minutes, and they will be your sponsor on every platform in the network.'; + // /api/sponsor caps the bio at 220 characters, so a capped bio ends mid-word: trim it back to a word and add an ellipsis + const bio = sp.bio && sp.bio.length >= 220 ? sp.bio.slice(0, sp.bio.lastIndexOf(' ')).replace(/[\s,;:.—-]+$/, '') + '…' : sp.bio; + $('prText').textContent = bio ? bio : 'They can help you get set up in a few minutes, and they will be your sponsor on every platform in the network.'; $('prJoin').textContent = 'Join with ' + sp.name; $('prJoin').href = '/join/' + encodeURIComponent(tok) + '?v=wide'; $('prIni').textContent = String(sp.name).replace(/^@/, '').slice(0, 1).toUpperCase() || '?'; diff --git a/public/presentation.html b/public/presentation.html index 24bcc62..e5036dd 100644 --- a/public/presentation.html +++ b/public/presentation.html @@ -86,6 +86,6 @@