feat(kb): render Mermaid diagrams in Knowledge Base viewer

Installs mermaid v11 and adds a custom ReactMarkdown code renderer
that intercepts fenced mermaid blocks and renders them as SVG diagrams
using the dark theme. SVGs are made responsive (width: 100%).
Non-mermaid code blocks are unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 15:37:00 -06:00
parent 7c0ba41514
commit 2fead2cfef
2 changed files with 87 additions and 2 deletions

View File

@@ -8,6 +8,7 @@
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^13.5.0",
"lucide-react": "^0.563.0",
"mermaid": "^11.14.0",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-markdown": "^10.1.0",