yzane / vscode-markdown-pdf

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

"syntax error in text" Mermaid 10.4.0 #337

Open rjaus opened 1 year ago

rjaus commented 1 year ago

Problem: "Syntax error in text mermaid version 10.4.0" image

Occurring in PDF & PNG export. (haven't tested any other formats).

Using as VS Code extension.

Mermaid syntax in question: (as taken from example docs):

stateDiagram
    [*] --> First
    state First {
        [*] --> second
        second --> [*]
    }

But it's happening on every sequenceDiagram as well.

rjaus commented 1 year ago
stateDiagram
    [*] --> First
    state First {
        [*] --> second
        second --> [*]
    }
cwardBarr commented 1 year ago

It works if you change your mermaid server to point to a previous version of mermaid. I found this solution in an older thread.

Find your Markdown PDF extension in the extensions tab, then click the gear. Choose Extension Settings. In the page that opens, find "Mermaid Server" and update the server to the test shown below which references a 9.0.1 version:

https://unpkg.com/mermaid@9.0.1/dist/mermaid.min.js

rjaus commented 1 year ago

Thank you, that worked.

I updated to the latest version of the extension, and it now seems to output the mermaid graphs as their markdown syntax (unrendered).

Your solution worked with the latest version.

LarsOevlisen commented 11 months ago

Switching between versions manually, the most recent mermaid version that worked for me when testing was:

https://cdn.jsdelivr.net/npm/mermaid@10.4.0/dist/mermaid.min.js

(https://github.com/mermaid-js/mermaid/releases).