Skip to content

Commit a609133

Browse files
authored
Fix HLJS returning an unusable name with Lang detection. (#57)
1 parent bed0a68 commit a609133

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

web/password.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<!-- SCRIPTS -->
1919
<script src="/static/scripts/initialTheme.js?v=1"></script>
20-
<script src="/static/scripts/utils.js"></script>
20+
<script src="/static/scripts/utils.js?v=2"></script>
2121
<script src="/static/scripts/themes.js?v=1" defer></script>
2222
<script src="/static/scripts/hidecopy.js?v=1" defer></script>
2323
<script src="/static/scripts/highlightsHTMX.js?v=5"></script>

web/paste.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<!-- SCRIPTS -->
1818
<script src="/static/scripts/initialTheme.js?v=1"></script>
19-
<script src="/static/scripts/utils.js"></script>
19+
<script src="/static/scripts/utils.js?v=2"></script>
2020
<script src="/static/scripts/themes.js?v=1" defer></script>
2121
<script src="/static/scripts/hidecopy.js?v=1" defer></script>
2222
<script src="/static/scripts/highlights.js?v=5" defer></script>

web/static/scripts/utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ function getLangByName(name) {
1010
if (!lang) {
1111
return null
1212
}
13-
return lang.name;
13+
14+
let lname = lang.name.replace(/\s+/g, '').toLowerCase();
15+
return lname;
1416
}

0 commit comments

Comments
 (0)