-
Notifications
You must be signed in to change notification settings - Fork 250
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
Unable to parse class diagram on v10.1.0 #532
Comments
Have you seen this https://github.com/mermaid-js/mermaid-cli#install-with-brew? |
I am using this through |
Issue confirmed. I've even tested with the Mermaid v10.2.0-rc.2 candidate, and it didn't help. There has been a bunch of recent updates to class diagrams in Mermaid recently (e.g. mermaid-js/mermaid@ba632ff), so I'm hoping that maybe the soon to be released Mermaid v10.2.0 might fix this issue. This diagram works fine in https://mermaid.live and on GitHub, so it must be a mermaid-cli issue: classDiagram-v2
class Pancake {
}
class Waffle {
}
|
Thank you for confirming. Sorry for sleeping. |
Currently, `mermaid-cli` renders mermaid diagrams by: mmd code → HTML `<div>` contexts → mermaid.run() → HTML `<svg>` However, when converting the mmd code to HTML `<div>`, newlines and whitespace formatting may get removed. For the majority of diagrams, this is no issue, but for some diagrams (e.g. classDiagram), whitespace does matter. The mermaid API has a `mermaid.render()` function that we can use instead, which parses in mmd code directly, without having to go through a HTML element first: mmd code → mermaid.render() → SVG → HTML `<svg>` As an aditional benefit, we get better error messages from Mermaid too! Fixes: mermaid-js#532
Currently, `mermaid-cli` renders mermaid diagrams by: mmd code → HTML `<div>` contexts → mermaid.run() → HTML `<svg>` However, when converting the mmd code to HTML `<div>`, newlines and whitespace formatting may get removed. For the majority of diagrams, this is no issue, but for some diagrams (e.g. classDiagram), whitespace does matter. The mermaid API has a `mermaid.render()` function that we can use instead, which parses in mmd code directly, without having to go through a HTML element first: mmd code → mermaid.render() → SVG → HTML `<svg>` As an additional benefit, we get better error messages from Mermaid (they're now proper JavaScript `Error`s!) Fixes: mermaid-js#532
Currently, `mermaid-cli` renders mermaid diagrams by: mmd code → HTML `<div>` contexts → mermaid.run() → HTML `<svg>` However, when converting the mmd code to HTML `<div>`, newlines and whitespace formatting may get removed. For the majority of diagrams, this is no issue, but for some diagrams (e.g. classDiagram), whitespace does matter. The mermaid API has a `mermaid.render()` function that we can use instead, which parses in mmd code directly, without having to go through a HTML element first: mmd code → mermaid.render() → SVG → HTML `<svg>` As an additional benefit, we get better error messages from Mermaid (they're now proper JavaScript `Error`s!) Fixes: #532
Describe the bug
Unable to parse classes on macOS on 10.1.0. Produces the following error (truncated)
To Reproduce
Steps to reproduce the behavior:
npm mmdc
to produce and output. Something likenpm mmdc -i example.txt -o output.png
Expected behavior
Expect an image file named
output.png
to contain two classes Pancake and Waffle.Desktop (please complete the following information):
Additional context
I have looked into issues #433 and #503 and neither seem to offer anything that helps
The text was updated successfully, but these errors were encountered: