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
View file

@ -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);