This repository was archived by the owner on Dec 5, 2024. It is now read-only.
Commit dd4a940 1 parent 394bf3d commit dd4a940 Copy full SHA for dd4a940
File tree 4 files changed +76
-3
lines changed
4 files changed +76
-3
lines changed Original file line number Diff line number Diff line change @@ -960,6 +960,62 @@ export default function MDXContent({
960
960
MDXContent.isMDXComponent = true;"
961
961
`;
962
962
963
+ exports[`fusuma-loader should convert mermaid using mermaid attr 1`] = `
964
+ "/* @jsxRuntime classic */
965
+ /* @jsx mdx */
966
+
967
+ import React from 'react';
968
+ import { mdx } from '@mdx-js/react';
969
+ export const slides = [props => <>
970
+
971
+ <h1>{\`FlowChart\`}</h1>
972
+
973
+ </>, props => <>
974
+
975
+ <div className=\\"mermaid\\" id=\\"mermaid-1\\" data-value=\\"graph TD;
976
+ A-->B;
977
+ A-->C;
978
+ B-->D;
979
+ C-->D;\\" style={{
980
+ visibility: 'hidden'
981
+ }}>graph TD;
982
+ A-->B;
983
+ A-->C;
984
+ B-->D;
985
+ C-->D;</div>
986
+
987
+ </>];
988
+ export const backgrounds = [0, 0];
989
+ export const fragmentSteps = [0, 0];
990
+ export const fusumaProps = [{}, {}];
991
+
992
+ const layoutProps = {
993
+
994
+ };
995
+ const MDXLayout = \\"wrapper\\"
996
+ export default function MDXContent({
997
+ components,
998
+ ...props
999
+ }) {
1000
+ return <MDXLayout {...layoutProps} {...props} components={components} mdxType=\\"MDXLayout\\">
1001
+ <h1>{\`FlowChart\`}</h1>
1002
+ <hr></hr>
1003
+ <pre><code parentName=\\"pre\\" {...{
1004
+ \\"className\\": \\"language-mermaid\\"
1005
+ }}>{\`graph TD;
1006
+ A-->B;
1007
+ A-->C;
1008
+ B-->D;
1009
+ C-->D;
1010
+ \`}</code></pre>
1011
+
1012
+ </MDXLayout>;
1013
+ }
1014
+
1015
+ ;
1016
+ MDXContent.isMDXComponent = true;"
1017
+ `;
1018
+
963
1019
exports[`fusuma-loader should return normal md 1`] = `
964
1020
"/* @jsxRuntime classic */
965
1021
/* @jsx mdx */
Original file line number Diff line number Diff line change @@ -93,6 +93,23 @@ graph TD;
93
93
expect ( await transformToJS ( src ) ) . toMatchSnapshot ( ) ;
94
94
} ) ;
95
95
96
+ test ( 'should convert mermaid using mermaid attr' , async ( ) => {
97
+ const src = `
98
+ # FlowChart
99
+ ---
100
+
101
+ \`\`\`mermaid
102
+ graph TD;
103
+ A-->B;
104
+ A-->C;
105
+ B-->D;
106
+ C-->D;
107
+ \`\`\`
108
+ ` ;
109
+
110
+ expect ( await transformToJS ( src ) ) . toMatchSnapshot ( ) ;
111
+ } ) ;
112
+
96
113
test ( 'should convert MathJax' , async ( ) => {
97
114
const src = `
98
115
# MathJax
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ function mdxPlugin() {
148
148
}
149
149
150
150
if ( type === 'code' ) {
151
- if ( lang === 'chart' ) {
151
+ if ( lang === 'chart' || lang === 'mermaid' ) {
152
152
slide . push ( {
153
153
...n ,
154
154
...transformChartToJSX ( mermaidId , value ) ,
Original file line number Diff line number Diff line change 4
4
5
5
<br />
6
6
7
- ``` chart
7
+ ``` mermaid
8
8
graph TD;
9
9
A-->B;
10
10
A-->C;
@@ -21,7 +21,7 @@ https://github.com/knsv/mermaid
21
21
<br />
22
22
23
23
``` txt
24
- \`\`\`chart
24
+ \`\`\`mermaid
25
25
graph TD;
26
26
A-->B;
27
27
A-->C;
You can’t perform that action at this time.
0 commit comments