diff --git a/pageUpdater.js b/pageUpdater.js
index 4d88a71..0bf117c 100644
--- a/pageUpdater.js
+++ b/pageUpdater.js
@@ -36,7 +36,7 @@ for (var i = 0; i < globResult.length; i++) {
})
}
-(async function() {
+(async function () {
globResult = glob.globSync("**/static/**/*.js", { absolute: true })
for (var i = 0; i < globResult.length; i++) {
javascriptCache[globResult[i]] = await minify({
@@ -156,13 +156,18 @@ function highlighter(json, full = true) {
classes = `class="${classes}"`
}
- var replacement = `${startContent + highTable[index] + endContent}`
+ var stuff = (startContent + highTable[index] + endContent).trim()
- if (link) {
- replacement = `${replacement}`
+ if (!stuff.includes("span")) {
+ var replacement = `${stuff}`
+
+ if (link) {
+ replacement = `${replacement}`
+ }
+ element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd)
+ } else {
+ element.content = element.content.replace(termKey, highTable[index])
}
-
- element.content = element.content.substring(0, spanStart) + replacement + element.content.substring(spanEnd)
}
}