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) {