agoose77 / markdown-it-diagrams

A simple markdown-it extension to add support for mermaid and svgbob diagrams.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

es6 syntax

davibe opened this issue · comments

this module is using import .. from .. es6 module syntax. Should it be transpiled before publishing ? Because afaik node.js does not support that yet so the module fails importing in plain node.js projects

Yes, I'm using this in another project which gets transpiled. Feel free to make a PR - I don't have much time to look at this just yet! Cheers

I have tried, it's simple. However it's useless because mermaid.js seems to use window, which is not available in node :( mermaid-js/mermaid#485

To give more context I am using parceljs to compile markdown files to a final static app. It is working great for markdown-it, css, syntax hilight with hl.js, but i am missing mermaid.js diagrams, so...

Thanks for taking a look.
I'm not really familiar with node / JS beyond a surface level. Can you use something like puppeteer to invoke mermaid?