mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-22 20:42:40 +00:00
Hljs small fix
This commit is contained in:
parent
b56e02e3ed
commit
bd64922554
1 changed files with 2 additions and 2 deletions
4
public/main.js
vendored
4
public/main.js
vendored
|
@ -35,8 +35,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
|
||||||
document.querySelectorAll('.table-code').forEach((el) => {
|
document.querySelectorAll('.table-code').forEach((el) => {
|
||||||
let ext = el.dataset.filename.split('.').pop()
|
let ext = el.dataset.filename.split('.').pop()
|
||||||
if (ext!== 'txt') {
|
|
||||||
|
if (hljs.autoDetection(ext) && ext !== 'txt') {
|
||||||
el.querySelectorAll('td.line-code').forEach((ell) => {
|
el.querySelectorAll('td.line-code').forEach((ell) => {
|
||||||
ell.classList.add('language-'+ext)
|
ell.classList.add('language-'+ext)
|
||||||
hljs.highlightElement(ell);
|
hljs.highlightElement(ell);
|
||||||
|
|
Loading…
Reference in a new issue