Will no longer highlight an already highlighted word
This commit is contained in:
parent
8949bbfd01
commit
366b1e552b
3 changed files with 7 additions and 5 deletions
|
@ -64,8 +64,8 @@
|
|||
"Fedi": "rgb(175, 125, 200)",
|
||||
"Matrix": "limegreen",
|
||||
"Element": "rgb(100, 255, 200)",
|
||||
"Code": "rgb(150, 175, 255)",
|
||||
"Codeberg": "rgb(0, 255, 255)",
|
||||
"Code": "rgb(150, 175, 255)",
|
||||
"Docker": "blue",
|
||||
"Github": "gray",
|
||||
"Steam": "lightgray",
|
||||
|
|
|
@ -142,13 +142,15 @@ function converter(html) {
|
|||
|
||||
for (let index = 0; index < highTable.length; index++) {
|
||||
var term = highTable[index];
|
||||
var replacement = `<span style="color: ${highlightedWords[term]}">${term}</span>`
|
||||
|
||||
|
||||
element.content = element.content.replaceAll(`{${term}}`, "TEMPORARY_REPLACE")
|
||||
element.content = element.content.replaceAll(term, replacement)
|
||||
element.content = element.content.replaceAll(term, "{TERM" + index + "}")
|
||||
element.content = element.content.replaceAll("TEMPORARY_REPLACE", `${term}`)
|
||||
}
|
||||
|
||||
for (let index = 0; index < highTable.length; index++) {
|
||||
element.content = element.content.replaceAll("{TERM" + index + "}", `<span style="color: ${highlightedWords[highTable[index]]}">${highTable[index]}</span>`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<div>
|
||||
<h3>Coding</h3>
|
||||
<a class="chip" href="https://git.violets-purgatory.dev/bingus_violet/">Forgejo: bingus_violet (git.violets-purgatory.dev)</a>
|
||||
<a class="chip" href="https://codeberg.org/Bingus_violet">{Code}berg: bingus_violet</a>
|
||||
<a class="chip" href="https://codeberg.org/Bingus_violet">Codeberg: bingus_violet</a>
|
||||
<a class="chip" href="https://hub.docker.com/u/bingusviolet">Docker: bingusviolet</a>
|
||||
<a class="chip" href="https://github.com/violets-puragtory">Github: violets-puragtory</a>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue