mirror of
https://github.com/thomiceli/opengist.git
synced 2024-12-22 20:42:40 +00:00
Detect .c and .h files (#119)
This commit is contained in:
parent
2b9eb8e127
commit
bae18ecb0a
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue