From 795748457c52edb748b4de9a165dd565020c618f Mon Sep 17 00:00:00 2001 From: x4e <53862811+x4e@users.noreply.github.com> Date: Sun, 24 Jan 2021 01:24:12 +0000 Subject: [PATCH] Case insensitive language highlighting matching This automatically lowercases language names used in code blocks when finding highlighting scripts for them, since highlightJS defines all languages with lowercase names. --- templates/include/post-render.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/include/post-render.tmpl b/templates/include/post-render.tmpl index c4ed082..beb98aa 100644 --- a/templates/include/post-render.tmpl +++ b/templates/include/post-render.tmpl @@ -68,7 +68,7 @@ var jss = [hlbaseUri + "highlight.min.js"]; // Check what we need to load for (i=0; i < lb.length; i++) { - lang = lb[i].className.replace('language-',''); + lang = lb[i].className.replace('language-','').toLowerCase(); // Support the aliases specified above if (aliasmap[lang]) lang = aliasmap[lang]; lurl = hlbaseUri + "highlightjs/" + lang + ".min.js";