-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"pre" tag removes empty lines; broken diagram #10
Comments
Note that GitHub works fine ;) |
This seems not related to the module, this issue also appears on example with pure HTML. <html>
<body>
Here is one mermaid diagram:
<pre class="mermaid">
graph TD
A[Client] --> B[Load Balancer]
B --> C[Server1]
B --> D[Server22]
</pre>
And here is another:
<pre class="mermaid">
graph TD
A[Client] -->|tcp_123| B
B(Load Balancer)
B -->|tcp_456| C[Server1]
B -->|tcp_456| D[Server2]
</pre>
<pre class="mermaid">
classDiagram
direction LR
class Serializable {
<<interface>>
}
</pre>
<pre class="mermaid">
classDiagram
class BankAccount
BankAccount : +String owner
BankAccount : +Bigdecimal balance
BankAccount : +deposit(amount)
BankAccount : +withdrawal(amount)
</pre>
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
mermaid.initialize({ startOnLoad: true });
</script>
</body>
</html> |
You may need to request help from https://github.com/mermaid-js/mermaid/issues with the example (pure HTML) above. Btw, you can use
|
Thanks Razon, Ok, I'll report to them, interestingly GitHub doesn't have this issue. Adding
The same diagram without classDiagram
class WashingMachine {
+MachineState currentState
+startWashing() : void
+stopWashing() : void
}
class MachineState {
<<Enumeration>>
ON
OFF
}
WashingMachine --> MachineState
|
I noticed that the diagram should be escaped, otherwise unable to be parsed, should be fixed since v0.1.2 |
After upgrade, much better, but I just caught this one, without adding
When I add "comment"
|
This is website I am working, I love "hbstack" ;) |
Seems the JS library vary relys on diagrams formats (tabs), have to format the diagram in some way. I made a new patch and drafted a new release v0.1.3, it works on your cases, but I'm not sure if it's perfect for other diagrams as well, if you found any diagrams not working, please provide, I will add it on https://hugomods.com/docs/content/mermaid/ to test this module. |
Thanks; I found workaround at Mermaid forum, documenting here: use classDiagram
class CurryingExample {
+Function~Integer#44;Function~Integer#44;Function~Integer#44;Integer~~~ addThree()$
+void main(String[] args)$
}
Other than that... no any issues anymore! |
You're welcome, btw, there is another approach to generate diagram without JavaScript, please check out Kroki docs if you're interested in. |
Here is scenario:
[PAGE]
example diagram
Rendered page shows error message; check HTML, empty line removed before
</pre>
tag. But, when I add comment, it works:The text was updated successfully, but these errors were encountered: