Skip to content

Commit 2e5da56

Browse files
committed
fix: change mermaid hidden class definition
workaround issue mermaid-js/mermaid#6452 Signed-off-by: Jean-Baptiste Bianchi <[email protected]>
1 parent 407cecb commit 2e5da56

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ flowchart TD
339339
root-entry-node --> /do/0/step1
340340
341341
342-
classDef hidden display: none;
342+
classDef hidden width: 1px, height: 0px, opacity: 0;
343343
*/
344344
```
345345

@@ -352,7 +352,7 @@ flowchart TD
352352
root-entry-node --> /do/0/step1
353353
354354
355-
classDef hidden display: none;
355+
classDef hidden width: 1px, height: 0px, opacity: 0;
356356
```
357357

358358
You can refer to the mermaid browser example for a live demo.

Diff for: src/lib/mermaid-converter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function convertToMermaidCode(workflow: Workflow): string {
7979
convertGraphToCode(graph) +
8080
`
8181
82-
classDef hidden display: none;`
82+
classDef hidden width: 1px, height: 0px, opacity: 0;` // should be "classDef hidden display: none;" but it can induce a Mermaid bug - https://github.com/mermaid-js/mermaid/issues/6452
8383
);
8484
}
8585

Diff for: tests/mermaid/mermaid.spec.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ do:
2424
root-entry-node --> /do/0/initialize
2525
2626
27-
classDef hidden display: none;`.trim(),
27+
classDef hidden width: 1px, height: 0px, opacity: 0;`.trim(),
2828
);
2929
});
3030

@@ -49,7 +49,7 @@ do:
4949
root-entry-node --> /do/0/initialize
5050
5151
52-
classDef hidden display: none;`.trim(),
52+
classDef hidden width: 1px, height: 0px, opacity: 0;`.trim(),
5353
);
5454
});
5555

@@ -81,7 +81,7 @@ classDef hidden display: none;`.trim(),
8181
root-entry-node --> /do/0/initialize
8282
8383
84-
classDef hidden display: none;`.trim(),
84+
classDef hidden width: 1px, height: 0px, opacity: 0;`.trim(),
8585
);
8686
});
8787

@@ -106,7 +106,7 @@ do:
106106
root-entry-node --> /do/0/initialize
107107
108108
109-
classDef hidden display: none;`.trim(),
109+
classDef hidden width: 1px, height: 0px, opacity: 0;`.trim(),
110110
);
111111
});
112112

@@ -133,7 +133,7 @@ do:
133133
root-entry-node --> root-exit-node
134134
135135
136-
classDef hidden display: none;`.trim(),
136+
classDef hidden width: 1px, height: 0px, opacity: 0;`.trim(),
137137
);
138138
});
139139

@@ -176,7 +176,7 @@ do:
176176
root-entry-node --- /do/0/checkup-entry-node
177177
178178
179-
classDef hidden display: none;`.trim(),
179+
classDef hidden width: 1px, height: 0px, opacity: 0;`.trim(),
180180
);
181181
});
182182
});

0 commit comments

Comments
 (0)