mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 02:36:07 +02:00
fix(sidebar): duplicate equations rendering
This commit is contained in:
@@ -1450,6 +1450,9 @@ export function useMathRendering(containerRef: RefObject<HTMLElement>, 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) {
|
||||
|
||||
Reference in New Issue
Block a user