Keep the last 8 bold

This commit is contained in:
2026-02-13 21:50:38 -05:00
parent 82e25314f3
commit 9315433cb1

View File

@@ -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}<b>${lastEight}</b>`;
} else {
link.innerText = originalText;
}
link.style.color = "";
}, 2000);