Skip to content

Error viewing .mmd files where there is no text after the %% - and the comments are at the top of the .mmd file #165

Description

@jasonnewyork

I am using this https://marketplace.visualstudio.com/items?itemName=vstirbu.vscode-mermaid-preview extension version 2.1.2

Then I have an issue which occurs when I am trying to view .mmd files with the mermaid extension where I get this error "A syntax error was detected on line 3. Syntax error in text: Parse error on line 1: %%flowchart TB ^ Expecting 'NEWLINE', 'SPACE', 'GRAPH', got 'NODE_STRING'". The issue seems to be for some .mmd files like this...

%% ═══════════════════════════════════════════════════════════════════════
%%
%% ═══════════════════════════════════════════════════════════════════════
flowchart TB

where if I move the class to the first line the .mmd will then preview.

flowchart TB
%% ═══════════════════════════════════════════════════════════════════════
%%
%% ═══════════════════════════════════════════════════════════════════════

This does not happen on my peers workstations. I am using Windows - they are using Mac.

The strange thing is that I can create my own .mmd files like this that will work - even though the comment is at the front.

%% comment
classDiagram
class Person {
+String name
+String age
}

After further exploration I believe the issue is related to a comment line where there is no text after the %% - meaning this will work

flowchart TB
%% ═══════════════════════════════════════════════════════════════════════
%%A
%% ═══════════════════════════════════════════════════════════════════════

but this will not

flowchart TB
%% ═══════════════════════════════════════════════════════════════════════
%%
%% ═══════════════════════════════════════════════════════════════════════

Any assistance would be greatly appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions