mirror of
https://github.com/thomiceli/opengist
synced 2024-11-12 07:05:50 +01:00
Hljs small fix
This commit is contained in:
parent
b56e02e3ed
commit
bd64922554
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 New Issue
Block a user