Skip to content

Commit

Permalink
Hljs small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Mar 18, 2023
1 parent b56e02e commit bd64922
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bd64922

Please sign in to comment.