Closed UBessle closed 1 year ago
I've looked into the problem and the reason is, that Mermaid support in GitLab extension of flexmark markdown converter is a bit outdated.
In the beginning of Mermaid, the Mermaid syntax did enforce, that each statement had to be ended with a semicolon. Later the syntax was simplified and allowed simple line endings to close a statement.
Unfortunately the Mermaid option in the GitLab extension replaces all line endings with spaces in the generated HTML code.
Out of
```mermaid
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!;
it will generate
```html
<div class="mermaid">
sequenceDiagram participant Alice participant Bob Alice->>John: Hello John, how are you? loop Healthcheck John->>John: Fight against hypochondria end Note right of John: Rational thoughts <br/>prevail! John-->>Alice: Great! John->>Bob: How about you? Bob-->>John: Jolly good!
</div>
and that's no longer syntactically correct and parseable for Mermaid.
The workaround until a fix is, to use the old Mermaid syntax with semicolon as statement ending.
```mermaid
sequenceDiagram;
participant Alice;
participant Bob;
Alice->>John: Hello John, how are you?;
loop Healthcheck;
John->>John: Fight against hypochondria;
end;
Note right of John: Rational thoughts <br/>prevail!;
John-->>Alice: Great!;
John->>Bob: How about you?;
Bob-->>John: Jolly good!;
will be generated to
and that's working fine with Mermaid
would be fixed with PR https://github.com/avisi-cloud/structurizr-site-generatr/pull/240
I've activated the GitLab extension for Flexmark markdown converter with property structurizr.markdown.flexmark.extensions
When i extend the sample page 02-markdown-features.md with an actual example from https://mermaid.js.org/syntax/sequenceDiagram.html i'll get a syntax error warning from mermaid
So the following code is not working