From 67a48bbec7f7a276715b94ffb0975aff14cb6733 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 11 Apr 2026 14:14:18 +0300 Subject: [PATCH] fix(sidebar): duplicate equations rendering --- apps/client/src/widgets/react/hooks.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx index 3c60aed206..945bad29e5 100644 --- a/apps/client/src/widgets/react/hooks.tsx +++ b/apps/client/src/widgets/react/hooks.tsx @@ -1450,6 +1450,9 @@ export function useMathRendering(containerRef: RefObject, deps: unk const mathElements = containerRef.current.querySelectorAll(".math-tex"); for (const mathEl of mathElements) { + // Skip if already rendered by KaTeX + if (mathEl.querySelector(".katex")) continue; + try { math.render(mathEl.textContent || "", mathEl as HTMLElement); } catch (e) {