File tree 3 files changed +2452
-622
lines changed
3 files changed +2452
-622
lines changed Original file line number Diff line number Diff line change 36
36
"rehype-raw" : " ^7.0.0" ,
37
37
"rehype-sanitize" : " ^6.0.0" ,
38
38
"remark-gfm" : " ^4.0.0" ,
39
+ "remark-mermaidjs" : " 4.1.1" ,
39
40
"wouter" : " ^3.3.5"
40
41
},
41
42
"devDependencies" : {
Original file line number Diff line number Diff line change 1
1
import MarkdownBase from 'react-markdown' ;
2
2
import remarkGfm from 'remark-gfm' ;
3
+ import mermaid from 'remark-mermaidjs' ;
4
+
5
+ // We have to use an old version of remark-mermaidjs until they resolve this issue: remarkjs/react-markdown#680
6
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
+ type TODO_old_mermaid = any ;
3
8
4
9
/**
5
10
* Do not import this component directly. Use `Markdown` instead.
6
11
*/
7
12
export default function Markdown ( { children} : { children : string } ) {
8
- return < MarkdownBase rehypePlugins = { [ remarkGfm ] } > { children } </ MarkdownBase > ;
13
+ return (
14
+ < MarkdownBase remarkPlugins = { [ remarkGfm , mermaid as TODO_old_mermaid ] } >
15
+ { children }
16
+ </ MarkdownBase >
17
+ ) ;
9
18
}
You can’t perform that action at this time.
0 commit comments