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

.-> dotted arrows cause syntax error in newest Mermaid release #5381

Open
tomjn opened this issue Mar 13, 2024 · 3 comments
Open

.-> dotted arrows cause syntax error in newest Mermaid release #5381

tomjn opened this issue Mar 13, 2024 · 3 comments
Labels
Graph: Flow Type: Bug / Error Something isn't working or is incorrect

Comments

@tomjn
Copy link

tomjn commented Mar 13, 2024

Description

Recently our github mermaid diagrams broke, and they started failing in the mermaid live tester.

I tracked this down to .->, removing dotted lines fixed the issue.

Steps to reproduce

This diagram generates syntax errors:

flowchart TD
	start[First]--"label"-->second[Second]
	second.->third[[Third]]
	second.->fourth(Fourth)
Loading

The same diagram using --> instead of .-> does not:

flowchart TD
	start[First]--"label"-->second[Second]
	second-->third[[Third]]
	second-->fourth(Fourth)
Loading

Screenshots

Screenshot 2024-03-13 at 14 47 15

Code Sample

flowchart TD
	start[First]--"label"-->second[Second]
	second.->third[[Third]]
	second.->fourth(Fourth)

Setup

  • Mermaid version: 10.9.0
  • Browser and Version: Chrome

Suggested Solutions

No response

Additional Context

No response

@tomjn tomjn added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Mar 13, 2024
@tomjn tomjn changed the title .-> causes syntax error .-> dotted arrows cause syntax error in newest Mermaid release Mar 13, 2024
@tomjn
Copy link
Author

tomjn commented Mar 13, 2024

The test case can be simplified further:

flowchart TD
	one.->two

@tomjn
Copy link
Author

tomjn commented Mar 13, 2024

Further investigation reveals that this works:

flowchart TD
	one .-> two

But this does not:

flowchart TD
	one.-> two

Previously it worked

@sidharthv96 sidharthv96 removed the Status: Triage Needs to be verified, categorized, etc label Mar 26, 2024
@sidharthv96
Copy link
Member

Thanks for the detailed report @tomjn!
Github's version jump was very broad, 10.0.2 to 10.8.0, more than a year's work. Although we keep backwards compatibility in the syntax as a very important criteria (even in major version changes), some things get through unintentionally.

We'll try to investigate what the issue was, but .-> working had not been intentional, as the documentation mentions -.-> as a dotted arrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Flow Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

3 participants