From 691455417a7a06b4af9d86c68bdd123a7606a13e Mon Sep 17 00:00:00 2001
From: Mysty <29671945+EvieePy@users.noreply.github.com>
Date: Sat, 21 Dec 2024 23:54:28 +1000
Subject: [PATCH] Allow HLJS to return multiple languages
---
web/password.html | 2 +-
web/paste.html | 2 +-
web/static/scripts/utils.js | 5 +++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/web/password.html b/web/password.html
index 7cea66d..b1d5015 100644
--- a/web/password.html
+++ b/web/password.html
@@ -17,7 +17,7 @@
-
+
diff --git a/web/paste.html b/web/paste.html
index 658a3c4..1c06ae1 100644
--- a/web/paste.html
+++ b/web/paste.html
@@ -16,7 +16,7 @@
-
+
diff --git a/web/static/scripts/utils.js b/web/static/scripts/utils.js
index 7c8c142..4e12e4e 100644
--- a/web/static/scripts/utils.js
+++ b/web/static/scripts/utils.js
@@ -1,4 +1,4 @@
-function getLangByName(name) {
+function getLangByNameT(name) {
splat = name.split(".");
if (splat.length <= 1) {
return null
@@ -12,5 +12,6 @@ function getLangByName(name) {
}
let lname = lang.name.replace(/\s+/g, '').toLowerCase();
- return lname;
+ let lastN = lname.split(",")[0];
+ return lastN;
}
\ No newline at end of file