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