Skip to content

Commit

Permalink
feat(zbugs): support mermaid diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
tantaman committed Oct 21, 2024
1 parent fdf50fe commit 7c3210d
Show file tree
Hide file tree
Showing 3 changed files with 2,447 additions and 622 deletions.
1 change: 1 addition & 0 deletions apps/zbugs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"rehype-raw": "^7.0.0",
"rehype-sanitize": "^6.0.0",
"remark-gfm": "^4.0.0",
"remark-mermaidjs": "4.1.1",
"wouter": "^3.3.5"
},
"devDependencies": {
Expand Down
6 changes: 5 additions & 1 deletion apps/zbugs/src/components/markdown-internal.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import MarkdownBase from 'react-markdown';
import remarkGfm from 'remark-gfm';
// import mermaid from 'rehype-mermaid';
import mermaid from 'remark-mermaidjs';

/**
* Do not import this component directly. Use `Markdown` instead.
*/
export default function Markdown({children}: {children: string}) {
return <MarkdownBase rehypePlugins={[remarkGfm]}>{children}</MarkdownBase>;
return (
<MarkdownBase remarkPlugins={[remarkGfm, mermaid]}>{children}</MarkdownBase>
);
}
Loading

0 comments on commit 7c3210d

Please sign in to comment.