Skip to content

Commit

Permalink
Detect .c and .h files (thomiceli#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Sep 28, 2023
1 parent 2b9eb8e commit bae18ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions public/hljs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ document.querySelectorAll('.markdown').forEach((e: HTMLElement) => {

document.querySelectorAll<HTMLElement>('.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<HTMLElement>('td.line-code').forEach((ell) => {
ell.classList.add('language-' + ext);
hljs.highlightElement(ell);
Expand Down

0 comments on commit bae18ec

Please sign in to comment.