You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a requirement: to replace the charts saved in mermaid format in a markdown file (c.md) with actual images. So, I installed mermaid-cli and executed the following command:
mmdc -i c.md -o c_1.md
It's basically working fine, but there is a small issue:
There are multiple charts in c.md, and one of them has an incorrect format.
Expected behavior:
Skip the erroneous chart and convert the charts with the correct format. The erroneous chart should retain its original code in the markdown file.
Current behavior:
Encountering an erroneous chart results in an error and the process terminates.
The text was updated successfully, but these errors were encountered:
Encountering an erroneous chart results in an error and the process terminates.
In my opinion, this is expected behavior, and it's what I'd want mermaid-cli to do.
It might make sense to add an option (maybe something like --replace-invalid-mermaid) that prints a warning if a mermaid chart is invalid, something like what GitHub does:
Input
```mermaidflowchart This is my example invalid diagram.```
Output
Edit: By the way @alamise, I hope you don't mind, I edited your issue title! Please feel free to change it something else if you'd prefer.
aloisklink
changed the title
Resolving Error: Converting Markdown Charts with Mermaid-CLI
Ignore invalid diagrams in markdown instead of throwing error
May 30, 2023
I have a requirement: to replace the charts saved in mermaid format in a markdown file (
c.md
) with actual images. So, I installed mermaid-cli and executed the following command:It's basically working fine, but there is a small issue:
There are multiple charts in
c.md
, and one of them has an incorrect format.Expected behavior:
Skip the erroneous chart and convert the charts with the correct format. The erroneous chart should retain its original code in the markdown file.
Current behavior:
Encountering an erroneous chart results in an error and the process terminates.
The text was updated successfully, but these errors were encountered: