Updates after tests

This commit is contained in:
Knut Sveidqvist
2023-07-25 16:42:34 +02:00
parent cfbd38d5fa
commit 15c6dfcbb5
5 changed files with 40 additions and 22 deletions

View File

@@ -671,7 +671,7 @@ title: Simple flowchart
flowchart TD flowchart TD
A --> B A --> B
`, `,
{ flowchart: { titleTopMargin: 0 } } { flowchart: { titleTopMargin: 10 } }
); );
}); });
it('3192: It should be possieble to render flowcharts with invisible edges', () => { it('3192: It should be possieble to render flowcharts with invisible edges', () => {
@@ -682,7 +682,7 @@ title: Simple flowchart with invisible edges
flowchart TD flowchart TD
A ~~~ B A ~~~ B
`, `,
{ flowchart: { titleTopMargin: 0 } } { flowchart: { titleTopMargin: 10 } }
); );
}); });
it('4023: Should render html labels with images and-or text correctly', () => { it('4023: Should render html labels with images and-or text correctly', () => {

View File

@@ -58,6 +58,14 @@
</head> </head>
<body> <body>
<pre id="diagram" class="mermaid"> <pre id="diagram" class="mermaid">
---
title: Simple flowchart with invisible edges
---
flowchart TD
A ~~~ B
</pre
>
<pre id="diagram" class="mermaid2">
stateDiagram-v2 stateDiagram-v2
[*] --> Still [*] --> Still
Still --> [*] Still --> [*]
@@ -73,7 +81,7 @@ flowchart RL
a1 -- l2 --> a2 a1 -- l2 --> a2
end end
</pre> </pre>
<pre id="diagram" class="mermaid"> <pre id="diagram" class="mermaid2">
flowchart RL flowchart RL
subgraph "`one`" subgraph "`one`"
a1 -- l1 --> a2 a1 -- l1 --> a2
@@ -98,11 +106,11 @@ flowchart LR
way`"] way`"]
</pre </pre
> >
<pre id="diagram" class="mermaid"> <pre id="diagram" class="mermaid2">
classDiagram-v2 classDiagram-v2
note "I love this diagram!\nDo you love it?" note "I love this diagram!\nDo you love it?"
</pre> </pre>
<pre id="diagram" class="mermaid"> <pre id="diagram" class="mermaid2">
stateDiagram-v2 stateDiagram-v2
State1: The state with a note with minus - and plus + in it State1: The state with a note with minus - and plus + in it
note left of State1 note left of State1
@@ -147,7 +155,7 @@ mindmap
शान्तिः سلام 和平 `"] शान्तिः سلام 和平 `"]
</pre> </pre>
<pre id="diagram" class="mermaid"> <pre id="diagram" class="mermaid2">
%%{init: {"flowchart": {"defaultRenderer": "elk"}} }%% %%{init: {"flowchart": {"defaultRenderer": "elk"}} }%%
flowchart TB flowchart TB
%% I could not figure out how to use double quotes in labels in Mermaid %% I could not figure out how to use double quotes in labels in Mermaid
@@ -399,21 +407,31 @@ mindmap
mermaid.parseError = function (err, hash) { mermaid.parseError = function (err, hash) {
// console.error('Mermaid error: ', err); // console.error('Mermaid error: ', err);
}; };
// mermaid.initialize({
// // theme: 'forest',
// startOnLoad: true,
// logLevel: 0,
// flowchart: {
// // defaultRenderer: 'elk',
// useMaxWidth: false,
// // htmlLabels: false,
// htmlLabels: true,
// },
// // htmlLabels: false,
// gantt: {
// useMaxWidth: false,
// },
// useMaxWidth: false,
// });
mermaid.initialize({ mermaid.initialize({
// theme: 'forest', flowchart: { titleTopMargin: 10 },
startOnLoad: true, fontFamily: 'courier',
logLevel: 0, sequence: {
flowchart: { actorFontFamily: 'courier',
// defaultRenderer: 'elk', noteFontFamily: 'courier',
useMaxWidth: false, messageFontFamily: 'courier',
// htmlLabels: false,
htmlLabels: true,
}, },
// htmlLabels: false, fontSize: 16,
gantt: {
useMaxWidth: false,
},
useMaxWidth: false,
}); });
function callback() { function callback() {
alert('It worked'); alert('It worked');

View File

@@ -33,7 +33,7 @@
], ],
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@zenuml/core": "^3.0.0" "@zenuml/core": "^3.0.3"
}, },
"devDependencies": { "devDependencies": {
"mermaid": "workspace:^" "mermaid": "workspace:^"

View File

@@ -1,6 +1,6 @@
{ {
"name": "mermaid", "name": "mermaid",
"version": "10.2.4", "version": "10.4.0",
"description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.", "description": "Markdown-ish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.",
"type": "module", "type": "module",
"module": "./dist/mermaid.core.mjs", "module": "./dist/mermaid.core.mjs",

View File

@@ -40,7 +40,7 @@
"[" { this.begin('NODE');return 'NODE_DSTART'; } "[" { this.begin('NODE');return 'NODE_DSTART'; }
[\s]+ return 'SPACELIST' /* skip all whitespace */ ; [\s]+ return 'SPACELIST' /* skip all whitespace */ ;
// !(-\() return 'NODE_ID'; // !(-\() return 'NODE_ID';
[^\(\[\n\-\)\{\}]+ return 'NODE_ID'; [^\(\[\n\)\{\}]+ return 'NODE_ID';
<<EOF>> return 'EOF'; <<EOF>> return 'EOF';
<NODE>["][`] { this.begin("NSTR2");} <NODE>["][`] { this.begin("NSTR2");}
<NSTR2>[^`"]+ { return "NODE_DESCR";} <NSTR2>[^`"]+ { return "NODE_DESCR";}