From bd649225542a737061acdb6a348229a68e5635bb Mon Sep 17 00:00:00 2001 From: Thomas Miceli Date: Sat, 18 Mar 2023 23:30:37 +0100 Subject: [PATCH] Hljs small fix --- public/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/main.js b/public/main.js index 4092926..0ee3f65 100644 --- a/public/main.js +++ b/public/main.js @@ -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);