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

Syntax error with comments at the top of the diagram #101

Open
Lockszmith-GH opened this issue May 23, 2024 · 0 comments
Open

Syntax error with comments at the top of the diagram #101

Lockszmith-GH opened this issue May 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Lockszmith-GH
Copy link

Describe the bug
When comments are placed above the diagram type, a Syntax error appears.
Workaround: Moving the comments below the diagram type (in the code below it's below flowchart), rendering is flawless.

To Reproduce
Steps to reproduce the behavior:

  1. Create an .mmd file with the following code and save:
%% mermaid.js diagram, can be viewed with
%% VSCode Mermaid Editor extension (id: tomoyukim.vscode-mermaid-editor)
%% or
%% by pasting the content into https://mermaid.live editor
---
title: "Title"
---
%%{
    init: {
        "theme": "dark",
        "logLevel": "info",
        "flowchart": {
            "htmlLabels": true
        }
    }
}%%

flowchart TB
    start(["Start"])
    --> block["Some Block"]
    --> done(["End"])
  1. Open Mermaid:Preview diagram
  2. Get the error:

    Syntax error in text
    mermaid version 10.3.0

Expected behavior
Have it render just like in mermaid.live
or here in GitHub:

%% mermaid.js diagram, can be viewed with
%% VSCode Mermaid Editor extension (id: tomoyukim.vscode-mermaid-editor)
%% or
%% by pasting the content into https://mermaid.live editor
---
title: "Title"
---
%%{
    init: {
        "theme": "dark",
        "logLevel": "info",
        "flowchart": {
            "htmlLabels": true
        }
    }
}%%

flowchart TB
    start(["Start"])
    --> block["Some Block"]
    --> done(["End"])
Loading

Desktop (please complete the following information):

  • OS: Microsoft Windows 11 Enterprise 10.0.22621 Build 22621
  • VSCode version: 1.89.1 (system setup) (Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685)
  • Extension version: 0.19.1
@Lockszmith-GH Lockszmith-GH added the bug Something isn't working label May 23, 2024
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

1 participant