Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(sidebar): duplicate equations rendering
Elian Doran67a48bbec7f7
diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsxindex 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<HTMLElement>, deps: unkconst 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) {