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)",
|
"Fedi": "rgb(175, 125, 200)",
|
||||||
"Matrix": "limegreen",
|
"Matrix": "limegreen",
|
||||||
"Element": "rgb(100, 255, 200)",
|
"Element": "rgb(100, 255, 200)",
|
||||||
"Code": "rgb(150, 175, 255)",
|
|
||||||
"Codeberg": "rgb(0, 255, 255)",
|
"Codeberg": "rgb(0, 255, 255)",
|
||||||
|
"Code": "rgb(150, 175, 255)",
|
||||||
"Docker": "blue",
|
"Docker": "blue",
|
||||||
"Github": "gray",
|
"Github": "gray",
|
||||||
"Steam": "lightgray",
|
"Steam": "lightgray",
|
||||||
|
|
|
@ -142,13 +142,15 @@ function converter(html) {
|
||||||
|
|
||||||
for (let index = 0; index < highTable.length; index++) {
|
for (let index = 0; index < highTable.length; index++) {
|
||||||
var term = highTable[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}}`, "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}`)
|
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>
|
<div>
|
||||||
<h3>Coding</h3>
|
<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://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://hub.docker.com/u/bingusviolet">Docker: bingusviolet</a>
|
||||||
<a class="chip" href="https://github.com/violets-puragtory">Github: violets-puragtory</a>
|
<a class="chip" href="https://github.com/violets-puragtory">Github: violets-puragtory</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue