yzane / vscode-markdown-pdf

Markdown converter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=yzane.markdown-pdf
Other
990 stars 203 forks source link

Export to PDF not compatible with mermaid version 9.1.3 #290

Open JohnLuCN opened 2 years ago

JohnLuCN commented 2 years ago

Hi everyone, I encountered " Syntax error in graph, mermaid version 9.1.3" when trying to export to PDF, but it works well when trying with "export to HTML", which used to be working fine, not sure what's the problem now with the "export to PDF" function.

Anyone could help to check and get it fixed?

Thank you in advance~

yobuntu commented 2 years ago

Same error here

It works with html because there is no need to convert the mermaid code which is only copied to the final html document and interpreted with js code from there.

kometchtech commented 2 years ago

I don't know if this workaround is correct, but this error seems to occur starting from 9.1.0 of mermaid.js.

By changing the following parameters as follows, the error did not occur when exporting mermaid.

markdown-pdf.mermaidServer
https://unpkg.com/mermaid@9.0.1/dist/mermaid.min.js
zhouhao27 commented 2 years ago

I don't know if this workaround is correct, but this error seems to occur starting from 9.1.0 of mermaid.js.

By changing the following parameters as follows, the error did not occur when exporting mermaid.

markdown-pdf.mermaidServer
https://unpkg.com/mermaid@9.0.1/dist/mermaid.min.js

Where to change?

kometchtech commented 2 years ago

@zhouhao27 [configuration] -> [extension] -> [Markdown PDF] -> [Markdown-PDF: Mermaid Server]

image