Comments (3)
I suppose this line about not rolling your own markdown parser proved to be prophetic 😉
😆
The main reason we haven't switched yet is that:
- There are many implementations of Markdown, and we don't want to just support GFM when people might be using Pandoc markdown (or some other arbitrary Markdown spec)
- We didn't want to make breaking changes for existing users.
However, we're planning on making a v11 release once Mermaid makes a v11 release, and we're planning on finally dropping support for Node.JS v14 & Node.JS v16. So dropping support for some more unusual Markdown implementations might be okay too.
As a temporary measure, here are two remark plugins that actually use a real markdown parser that you can use:
- remark-mermaid-dataurl: Uses
mermaid-cli
under the hood, and embeds the generated SVGs into the markdown file as data URLs. - remark-mermaidjs: Embeds the generated SVGs in the markdown as plain SVGs.
from mermaid-cli.
Sounds like a plan! My toolchain involves pandoc
for manipulating and combining markdown files before running mermaid-cli
, so for future Googlers in the same situation for now, my solution was to write a very crude Lua filter to 'process' the mermaid code blocks explicitly:
function CodeBlock(elem)
local language = pandoc.utils.stringify(elem.classes)
if FORMAT:match 'gfm' and language == 'mermaid' then -- don't forget to change the markdown format here or make this more generic if needed
return {
pandoc.RawInline('markdown', '```mermaid'), -- basically just hardcode the block without the space
pandoc.RawBlock('markdown', elem.text),
pandoc.RawInline('markdown', '```')
}
end
return elem
end
from mermaid-cli.
I suppose this line about not rolling your own markdown parser proved to be prophetic 😉
from mermaid-cli.
Related Issues (20)
- Using a config file does not work HOT 1
- Frontformatter config is not respected 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 HOT 2
- 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
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.