1
0
mirror of https://github.com/thomiceli/opengist synced 2024-11-08 12:55:50 +01:00

Hljs small fix

This commit is contained in:
Thomas Miceli 2023-03-18 23:30:37 +01:00
parent b56e02e3ed
commit bd64922554
No known key found for this signature in database
GPG Key ID: D86C6F6390AF050F

4
public/main.js vendored

@ -35,8 +35,8 @@ document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.table-code').forEach((el) => {
let ext = el.dataset.filename.split('.').pop()
if (ext!== 'txt') {
if (hljs.autoDetection(ext) && ext !== 'txt') {
el.querySelectorAll('td.line-code').forEach((ell) => {
ell.classList.add('language-'+ext)
hljs.highlightElement(ell);