fix: fix already-formatted <mark>

no really, I hate this.
This commit is contained in:
Oliver Booth 2023-08-10 22:48:32 +01:00
parent 086a8a665c
commit cf615e1e81
Signed by: oliverbooth
GPG Key ID: 725DB725A0D9EE61

View File

@ -193,6 +193,11 @@ class UI {
element = element || document.body; element = element || document.body;
element.querySelectorAll("pre code").forEach((block) => { element.querySelectorAll("pre code").forEach((block) => {
let content = block.innerHTML; let content = block.innerHTML;
// but ugly fucking hack. I hate this
content = content.replaceAll('<span class="token operator">&lt;</span>mark<span class="token operator">&gt;</span>', "<mark>");
content = content.replaceAll('<span class="token operator">&lt;</span><span class="token operator">/</span>mark<span class="token operator">&gt;</span>', "</mark>");
content = content.replaceAll("&lt;mark&gt;", "<mark>"); content = content.replaceAll("&lt;mark&gt;", "<mark>");
content = content.replaceAll("&lt;/mark&gt;", "</mark>"); content = content.replaceAll("&lt;/mark&gt;", "</mark>");
block.innerHTML = content; block.innerHTML = content;