Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vs code, invalid syntax error on preview with plugin due to tildes #90

Open
azfeenixfire opened this issue Aug 3, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@azfeenixfire
Copy link

Describe the bug
Using vscode plugin to show preview of mermaid code. It kept giving a "syntax error in graph mermaid version 9.4.0".

To Reproduce
Steps to reproduce the behavior:
use mermaid code below and generate preview. Error should occur. Remove the 3 rows with the ~~~ and generate preview, error doesn't happen. It's just not working with the tildes.

flowchart TB
%%B --> sefact
%%B --> F
subgraph Color_Key
direction TB %% <-- here
mtbl[middle table]:::class1

~~~stbl[source table]
~~~strm[stream]
end

**Expected behavior**
a preview of the mermaid diagram

**Desktop (please complete the following information):**
- OS: Ventura 13.4.1(c)
- VSCode version 1.80.2 (Universal)
- Extension version 0.18.1


@azfeenixfire azfeenixfire added the bug Something isn't working label Aug 3, 2023
@tomoyukim
Copy link
Owner

Thank you for your report! I think this is caused by the old mermaid version. I published v0.19.1 with the latest mermaid.js. Could you try it?

@acsr
Copy link

acsr commented Jul 17, 2024

I published v0.19.1 with the latest mermaid.js. Could you try it?

I was also struggling with the tilde issue

Tilde issue remains

Updating the vscode-mermaid-editor plugin does not help

Updating the mermaid library manually does not help neither

I updated the mermaid library manually using your command successfully to 10.9.1 in your version v0.19.1
when installing mermaid.js 10.3.x was used as far as I remember.

Workaround -> Remove tilde based code

Removing the one solely ~~~ Link that was used made the graph code work again in your Plugins Preview.

It seems there is a Bug in your Code or VSCode when passing over the source from the open file not dealing properly with tildes.

Other Apps using mermaid.js working!

The same code works for me from mermaid.js v10.30 to v10.9.1 in other applications. (I use e.g. the fenced-code-plus plugin in the https://logseq.org desktop app to render mermaid code using mermaid.js v10.7.0

Debugging is hard

No debugging messages are actually showing up in the Output sections of VSCode or using the command: Mermaid Export: Show Log.

  • Can this be improved?
  • Is there another location to look this up?

Platform is VSCode 1.91.1 on macOS Ventura 13.6.7 Apple Silicon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants