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

Rendering or parsing a malformed graph definition freezes or crashes the browser #5877

Open
reakaleek opened this issue Sep 19, 2024 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@reakaleek
Copy link

reakaleek commented Sep 19, 2024

Description

When I use mermaid.run or mermaid.parse on a malformed graph definition, the browser freezes or crashes.

This will work:

sequenceDiagram
  participant Alice
  participant Bob
  Alice->>Bob: Hello

This will cause a freeze or crash

sequenceDiagram   participant Alice   participant Bob   Bob->>Alice: Hi Alice   Alice->>Bob: Hi Bob

Steps to reproduce

mermaid.parse('sequenceDiagram   participant Alice   participant Bob   Bob->>Alice: Hi Alice   Alice->>Bob: Hi Bob').catch(console.error)

Screenshots

image

Code Sample

https://stackblitz.com/edit/vitejs-vite-27qn1r?file=src%2FApp.tsx

Setup

  • Mermaid version: 11.2.1
  • Browser and Version: Version 1.69.168 Chromium: 128.0.6613.138 (Official Build) (arm64)

Suggested Solutions

No response

Additional Context

No response

@reakaleek reakaleek added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant