From bae18ecb0a161bf00237e2aa9b96fecedf80b5ce Mon Sep 17 00:00:00 2001 From: Thomas Miceli <27960254+thomiceli@users.noreply.github.com> Date: Thu, 28 Sep 2023 20:08:57 +0200 Subject: [PATCH] Detect .c and .h files (#119) --- public/hljs.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/hljs.ts b/public/hljs.ts index 1edfb93..9d3e588 100644 --- a/public/hljs.ts +++ b/public/hljs.ts @@ -21,8 +21,7 @@ document.querySelectorAll('.markdown').forEach((e: HTMLElement) => { document.querySelectorAll('.table-code').forEach((el) => { const ext = el.dataset.filename?.split('.').pop() || ''; - - if (hljs.autoDetection(ext) && ext !== 'txt') { + if (hljs.getLanguage(ext) && ext !== 'txt') { el.querySelectorAll('td.line-code').forEach((ell) => { ell.classList.add('language-' + ext); hljs.highlightElement(ell);