This commit is contained in:
2026-02-06 02:38:32 +03:00
parent d87d57ab3c
commit ba2ff52394

View File

@ -57,7 +57,7 @@ export function LessonContentViewer({ content, className }: LessonContentViewerP
if (!containerRef.current || !content) return; if (!containerRef.current || !content) return;
const mermaidNodes = containerRef.current.querySelectorAll('pre[data-language="mermaid"]'); const mermaidNodes = containerRef.current.querySelectorAll('pre[data-language="mermaid"]');
if (mermaidNodes.length === 0) return; if (mermaidNodes.length === 0) return;
mermaid.run({ nodes: Array.from(mermaidNodes), suppressErrors: true }).catch(() => {}); mermaid.run({ nodes: Array.from(mermaidNodes) as HTMLElement[], suppressErrors: true }).catch(() => {});
}, [content]); }, [content]);
if (!editor) return null; if (!editor) return null;