web/math: display error if katex fails

This commit is contained in:
Tulir Asokan 2024-11-02 19:56:02 +02:00
parent a31c68fc5d
commit c14c079d44

View file

@ -58,6 +58,10 @@ class HicliMath extends HTMLElement {
})
} catch (err) {
console.error("Failed to render math", this.#latex, err)
const errorNode = document.createElement("span")
errorNode.innerText = `Failed to render math: ${err}`
errorNode.style.color = "var(--error-color)"
this.#root.appendChild(errorNode)
}
}
}