shorten link in web app

This commit is contained in:
Brahim Hadriche committed 2024-04-04 11:24:20 -04:00
1 parent 1cbb52fad4
commit c741466a85
1 file changed
+3 -1
@@ -67,7 +67,9 @@
return `<a class="link" href="https://github.com/iBicha/playlet/releases/tag/v${value}" target="_blank" rel="noopener noreferrer">${value}</a>`;
case "lib_url":
const filename =
value && value.includes("/") && value.endsWith(".zip")
value &&
value.includes("/") &&
(value.endsWith(".zip") || value.endsWith(".pkg"))
? value.substring(value.lastIndexOf("/") + 1)
: value;
return `<a class="link" href="${value}" target="_blank" rel="noopener noreferrer">${filename}</a>`;