From 9315433cb127250ed83b69c2c1e1c63dc766d90b Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Fri, 13 Feb 2026 21:50:38 -0500 Subject: [PATCH] Keep the last 8 bold --- assets/javascripts/copy.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/copy.js b/assets/javascripts/copy.js index 801694d..0f4dfe5 100644 --- a/assets/javascripts/copy.js +++ b/assets/javascripts/copy.js @@ -18,7 +18,14 @@ async function handleCopy(event) { // 5. Reset after 2 seconds setTimeout(() => { - link.innerText = originalText; + // Check if the text is long enough to prevent errors + if (originalText.length >= 8) { + const firstPart = originalText.slice(0, -8); + const lastEight = originalText.slice(-8); + link.innerHTML = `${firstPart}${lastEight}`; + } else { + link.innerText = originalText; + } link.style.color = ""; }, 2000);