From c14c079d4418a0e9e45d1f57844c5ca8b72debc0 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Sat, 2 Nov 2024 19:56:02 +0200 Subject: [PATCH] web/math: display error if katex fails --- web/src/ui/timeline/content/math.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/ui/timeline/content/math.ts b/web/src/ui/timeline/content/math.ts index d41a8ee..7452e7b 100644 --- a/web/src/ui/timeline/content/math.ts +++ b/web/src/ui/timeline/content/math.ts @@ -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) } } }