Comments (11)
Same issue if I use <br>
tags instead of <br/>
tags
from mermaid-cli.
This is issue is the same/related to mermaid-js/mermaid-live-editor#26 and can be solved the same way.
@daladim : would you like to work on a PR?
from mermaid-cli.
Hi. Thanks for the info.
I am not sure I am experienced enough in JavaScript to make the PR myself, but let's see.
Jihchi has worked around this limitation in mermaid.ink. It is very simple and effective. It indeed is a warkaround, but I can't see any use case where a <br>
(that would not be an actual line break) would mistakenly be tampered by this workaround.
Otherwise, since <br>
is correct HTML and <br/>
is required for XML/XHTML compatibility, we might want to use an XMLSerializer instead of a plain .innerHTML
. This would be slightly more complex than the workaround above, but might work as well.
What is your opinion on this?
from mermaid-cli.
You are welcome to choose the solution yourself. A workaround is good enough, if it is faster to implement. We can always improve things 😄
from mermaid-cli.
@daladim : thank you so much for your contributions so far. I have tried the svg file with the <br>
and it does not give me any error in Firefox. https://github.com/mermaid-js/mermaid-cli/suites/1670560212/artifacts/31151542
The output of svg->png is different than just svg in Firefox for your test file. But no error is shown by the browser.
My Christmas proposal; please, implement the fix, leave the test file, add only a single test (no for loop) and I will gladly accept your contribution. If needed, I will perform a manual verification of the output svg file.
from mermaid-cli.
It is strange that you don't get any error in Firefox on your side...
I have just checked the .zip file you mentioned. Both Firefox 83.0 on Ubuntu 20.04 and Firefox 84.0.1 on Windows 10 display the Expected: </br>
error on my computer when I open graph-with-br.mmd.svg
, and this is the only .svg for which Nautilus does not display a preview...
Anyway, I'll push the fix as you asked asap (and sorry for the Christmas delays!)
from mermaid-cli.
@daladim : can I close this issue?
from mermaid-cli.
Well, this depends on what you think about the associated MR #79 that you've merged.
This merged MR should indeed fix the issue, but you mentioned errors that you kept having. As I can't remember how to test locally (it's been a long time, and I'm not a node/JS expert :-p ) I could not check that master was correct.
To be sure, I can test it if there was a tagged Docker image somewhere.
Please tell me how you want to proceed.
Thanks
from mermaid-cli.
Just run this command on the generated svg file as a workaround:
sed 's#<br>#<br/>#g' -i output.svg
from mermaid-cli.
Fixed by #171
from mermaid-cli.
I've just installed mermaid-cli via brew.
When running mermaid-cli against mermaid files containing <br>
im still facing this error. @kyww's workaround fixes the previously rendered SVG.
from mermaid-cli.
Related Issues (20)
- Error: net::ERR_ACCESS_DENIED on /@mermaid-js/mermaid-cli/dist/index.html HOT 3
- 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 HOT 1
- 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 9
- Upgrade mermaid to 10.9.0 (Latex support) HOT 2
- Write output to stdout HOT 1
- Document mermaid-cli release procedure
- mmdc not generating labels for SVG outputs HOT 2
- improve performance of markdown file processing HOT 2
- Version bump happens after tagging HOT 3
- Trying to use browserUrl or browserWSEndpoint without success HOT 2
- $c4ShapeInRow not counting per row
- No diagram found in mardown file when using whitespace in definition.
- Exported png files are very low resolution HOT 1
- SVG is not displayed corectly in Gimp, Pinta, display or Image viewer HOT 3
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.
tags
from mermaid-cli.