mjbvz / vscode-markdown-mermaid

Adds Mermaid diagram and flowchart support to VS Code's builtin markdown preview
https://marketplace.visualstudio.com/items?itemName=bierner.markdown-mermaid
MIT License
648 stars 119 forks source link

Syntax error in graph when ::: prefix is used #103

Closed RickDMyers closed 1 year ago

RickDMyers commented 3 years ago

When I first click on the markdown , the diagram displays correctly. If however, I start to edit he markdown (not the diagram), the display flickers and gives a syntax error. It then alternates between syntax error and sometime actually displays correctly for a brief moment.

If change to using "``` mermaid" tag, I don't have any problem at all

Here's a sample of the diagram that I'm trying to display.

I'm using VSCODE Version: 1.56.0-insider

::: mermaid
sequenceDiagram
    Unit4->>Blob Storage: GL Balance File
    SFTP Logic App->>Blob Storage: Read File (Event Grid)
    SFTP Logic App->>Blackline: Send File via SFTP
:::
Jasonkingsmill commented 3 years ago

I have this same issue. It appears the error gets triggered when saving the document. Adding any sort of white space anywhere, including outside the code block then renders the diagram correctly until the next save.

VSCode V1.55.2

zioalex commented 3 years ago

Same issue here with VSC v1.53.1 , Markdown Preview Mermaid v1.9.2 and Markdown All in One v3.4.0.

mjbvz commented 3 years ago

@zioalex This extension is for VS Code's built-in markdown preview. Markdown All in One has it's own preview (and I believe its own mermaid support)

bryanschremp commented 3 years ago

Still occurring:

Visual Studio Code Version: 1.58.1 (user setup) Commit: 2aeda6b18e13c4f4f9edf6667158a6b8d408874b Date: 2021-07-13T06:58:28.115Z (1 day ago) Electron: 12.0.13 Chrome: 89.0.4389.128 Node.js: 14.16.0 V8: 8.9.255.25-electron.0 OS: Windows_NT x64 10.0.22000

odelljl commented 3 years ago

This issue happens to me exclusively on save. As soon as I begin to edit again, the preview reappears. I find this is true whether MarkDown All-In-One is enabled or disabled.

Version: 1.59.1 (system setup) Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa Date: 2021-08-19T11:56:46.957Z Electron: 13.1.7 Chrome: 91.0.4472.124 Node.js: 14.16.0 V8: 9.1.269.36-electron.0 OS: Windows_NT x64 10.0.19043

dennisl68-castra commented 2 years ago

It's still a thing with

Version: 1.62.3 (user setup)
Commit: ccbaa2d27e38e5afa3e5c21c1c7bef4657064247
Date: 2021-11-17T08:11:14.551Z
Electron: 13.5.2
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19042
tcdejong commented 2 years ago

I have the same but inverse: syntax error with ```, but not with :::.

VS Code details:

Version: 1.67.2 (user setup)
Commit: c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
Date: 2022-05-17T18:15:52.058Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.19044

Extension version: v1.14.0

MVP:

:::mermaid

gantt
section Section
Completed :done,    des1, 2014-01-06,2014-01-08
Active       :active,  des2, 2014-01-07, 3d
Parallel 1   :         des3, after des1, 1d
Parallel 2   :         des4, after des1, 1d
Parallel 3   :         des5, after des3, 1d
Parallel 4   :         des6, after des4, 1d
:::

Works with the colons, not with triple backticks: "Syntax error in graph, mermaid version 9.1.1"

mjbvz commented 1 year ago

This works fine for me in the latest VS Code and extension version

Screenshot 2022-12-06 at 9 52 34 AM

Let me know if you're still seeing issues