Fix screwed up links, add possible highlight overwrite

This commit is contained in:
Bingus_Violet 2024-02-13 08:55:52 -06:00
parent 9ac680d5af
commit 48ea1dbd7f
2 changed files with 6 additions and 3 deletions

View file

@ -56,7 +56,10 @@ function converter(html) {
for (let index = 0; index < highTable.length; index++) {
var term = highTable[index];
var replacement = `<span style="color: ${highlightedWords[term]}">${term}</span>`
bodyHTML = bodyHTML.replaceAll(`{${term}}`, "TEMPORARY_REPLACE")
bodyHTML = bodyHTML.replaceAll(term, replacement)
bodyHTML = bodyHTML.replaceAll("TEMPORARY_REPLACE", `{${term}}`)
}
html = html.substring(0, html.indexOf("<body>")) + bodyHTML + html.substring(html.indexOf("</body>") + 7)