-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Status: TriageNeeds to be verified, categorized, etcNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrectSomething isn't working or is incorrect
Description
Description
When we want to create an arrow without a label:
sequenceDiagram
A ->> B: A calls B
%% ❌ Expecting 'TXT' got 'NEWLINE'
B ->> A
It crashes because it expects the colon at the end, but this doesn't work either
sequenceDiagram
A ->> B: A calls B
%% ❌ Expecting 'NEWLINE', 'AS', ',', 'SOLID_OPEN_ARROW', ... got 'INVALID'
B ->> A:
It only works after I add a blank space after the colon
sequenceDiagram
A ->> B: A calls B
%% ✅
B ->> A:
%% ⬆︎ invisible trailing whitespace at the end
We don't understand what makes the colon is required in the first place, but even if it is, why is the trailing whitespace mandatory?
We have our editors configured to remove trailing whitespace for code hygiene, but applying this to sequence diagrams leaves them broken, we either disable this from our editors or add an exception for Mermaid files.
Steps to reproduce
- Create an sequence diagram
- Create an arrow without a label
Screenshots
This is the wanted result.
Adding a label to the second arrow separates them.
Code Sample
sequenceDiagram
A ->> B: A calls B
B ->> A:
Setup
Mermaid version:
VS Code extension version 2.2.1.
Also reproducible in Github mermaid preview.
Suggested Solutions
- Not require whitespace after ':'
- Not require ':' for all arrows
Metadata
Metadata
Assignees
Labels
Status: TriageNeeds to be verified, categorized, etcNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrectSomething isn't working or is incorrect