Live data from Hacker News

Include diagrams in your Markdown files with Mermaid

github.blog

61–70 of 272 posts

Re: Include diagrams in your Markdown files with Mermaid

#62
post #9

I’m super excited for this! One thought though, on the syntax. Wouldn’t it be a bit odd if suddenly this line in a README.md: ```js const foo = 1 + 1 ``` Rendered as: `2` ? Isn’t that kind of what we’re doing here with the mermaid source tag? That tag is for showing source code, no? Feels like there should be another tag for rendering it.

Agreed; this is an annoying inconsistency. If you want to embed and render a non-Markdown file in Markdown, there's already another, far better syntax for that which is more in-line with the spirit of Markdown's "just text" philosophy:

![Chart](./charts/chart-file.mermaid)

Re: Include diagrams in your Markdown files with Mermaid

#64

Protip to anyone using Mermaid.js Don't. It's a sea shanty of XSS vulns. https://snyk.io/vuln/npm%3Amermaid

This seems to be incorrect, the current version has no CVEs according to that tracker.

I think the parent comment is just saying that multiple vulns have been found recently. There's a good chance there's more.

Re: Include diagrams in your Markdown files with Mermaid

#67
post #31

Mermaid is fantastic. Aside from mermaid, I've recently been introduced to nomnoml ( https://nomnoml.com/ ) and it is fantastic as well. My wish is for Mermaid and nomnoml to become universally supported among Markdown web renderers (I'm looking first and foremost at Github of course).

I'm using mermaid to render this route map for interactive fiction: https://fiction.live/tsukihime/Satsuki-Yumizuka-Route/4B9obc...

How does nomnoml compare? The results are with mermaid are not ideal for me.

Edit: That one above is actually relatively decent. The results with mermaid can get a lot worse, actually to the point of uselessness.

Terrible examples below

https://fiction.live/stories/The-Hypno-Games/eSSzPJ6qiqAC746...

https://fiction.live/stories/The-Gynarchy/czyGfAtJpRgtzGFmW/...

Re: Include diagrams in your Markdown files with Mermaid

#70

I think so-called ASCII-art is more in the spirit of Markdown. The nice thing about the original Markdown (modulo bugs) is that things are written the way one would write plaintext documents which are supposed to be easily read in a text editor. So you don’t write bullet lists like this: - Bullet 1 - Bullet 2 - Bullet 3 And hope that some post-processing will add linebreaks for you. You write it like this: - Bullet 1…

To that point, ASCIIFlow is an amazing tool which I use constantly when working on markdown files https://asciiflow.com/#/

I used it yesterday and really wished it supported dashed lines!
Post reply on HN