Comments (6)
Can you provide screenshots/error messages etc showing the error? From the description, it is not clear what does not work. BTW, can you attach the input file you use to the issue?
from mermaid-cli.
Replication file: replicate.zip (zipped so gitlab will allow attachment)
Note that this must be saved with CR/LF line endings for this error to appear.
Contents:
# My Fake Markdown
```mermaid
flowchart TB
test->chart
chart->test
```
I'm running this via docker in windows:
docker run -it -v D:/test_mermaid_md:/data minlag/mermaid-cli -i /data/replicate.md
Output from the program is
No mermaid charts found in Markdown input
Re-save the file as LF only line endings, and the same file produces
Found 1 mermaid charts in Markdown input
- /data/replicate-1.md.svg
When using Windows style CRLF endings, the regex (match(/^```(?:mermaid)(\n([\s\S]*?))```$/gm);
) will not match because it is looking for an explicit \n
, when in a Windows style CRLF file, the contents will be mermaid\r\n
from mermaid-cli.
OK. Thanks a lot for the input. I think the error can be fixed, but cannot give you an ETA 😉 BTW, would you like to work on the PR? I would be glad to review your work. I guess something similar to match(/^```(?:mermaid)(\r?\n([\s\S]*?))```$/gm);
should do the trick?
from mermaid-cli.
Never written any JS before but I'll see if I can take a crack at it this weekend 😃
Would you need a test case for it as well?
from mermaid-cli.
Fantastic! Yes, I would like a test.
Put the test data in here https://github.com/mermaid-js/mermaid-cli/tree/master/test-positive. You do not need to do anything else regarding the test!
Review manually that the fix removes the problem.
The automatic test will generate a new png file which will be kept as a reference file for the future regressions.
When you submit your PR, I will review it and accept. 😄
from mermaid-cli.
Thanks to the OP for pointing that out. I got stuck today just because of that.
FWIW, I also found that there should not be whitespaces right after ```mermaid
. (I'm not an expert on regex. So I can't tell whether it's obviously implied by the code itself.)
from mermaid-cli.
Related Issues (20)
- Using a config file does not work HOT 1
- Frontformatter config is not respected HOT 3
- No charts found when space between opening code fence and language name HOT 3
- Upgrade puppeteer HOT 1
- Unable to resolve types with TypeScript 5.3.3 / TSC 9.2.0 HOT 1
- Apply styles from inside mermaid graphs
- Bug: CSS Styling Not Applied to SVG (only PNG / static image)
- Add types for exports
- How can I configure maxEdges using the CLI? (Error: Too many edges) HOT 1
- Error: net::ERR_ACCESS_DENIED on /@mermaid-js/mermaid-cli/dist/index.html
- Error: Could not find Chromium (rev. 1108766) HOT 7
- Syntax Error in Mermaid-cli tool HOT 1
- background of edge label is white in pdf from flowchart
- Missing description in `-h, --help`
- Custom image output for .md file input
- SyntaxError: The requested module `@mermaid-js/mermaid-cli` does not provide an export named 'run' (via SyntaxError) HOT 1
- Formatting of diagram is changed when exported to svg, pdf or png
- Could not find Chromium (rev. 1108766) HOT 4
- Upgrade mermaid to 10.9.0 (Latex support) HOT 2
- Write output to stdout
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mermaid-cli.