From 3b4d14f19453f33644d398e538ff751862c3973c Mon Sep 17 00:00:00 2001 From: Marcel van der Boom Date: Thu, 29 Nov 2018 17:36:50 +0100 Subject: [PATCH] Only push language uri once on load stack --- templates/include/post-render.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/include/post-render.tmpl b/templates/include/post-render.tmpl index 8e694a0..7079ccd 100644 --- a/templates/include/post-render.tmpl +++ b/templates/include/post-render.tmpl @@ -44,8 +44,9 @@ // Check what we need to load for (i=0; i < lb.length; i++) { lang = lb[i].className.replace('language-',''); - if (!langs.includes(lang)) { - jss.push(hlbaseUri + "languages/" + lang + ".min.js"); + lurl = hlbaseUri + "languages/" + lang + ".min.js"; + if (!(langs.includes(lang) || jss.includes(lurl))) { + jss.push(lurl); } } // Load files in order, higlight on last load