Skip to content

Syntax error when using non-alphanumeric in architecture node label #6056

Open
@mgrubb

Description

Description

When using anything outside of [a-zA-Z0-9_ ] a syntax error is thrown.
This doesn't work:

architecture-beta
    group agroup(cloud)[Cloud-Name]
Loading

This does:

architecture-beta
    group agroup(cloud)[Cloud_Name]
Loading

Steps to reproduce

  1. Create mermaid architecture diagram
  2. Use a label that contains a - character
  3. Observe syntax error

Screenshots

image

Code Sample

See above

Setup

  • Mermaid version: 11.4.0
  • Browser and Version: Chrome 130.0.6723.117 [arm64], Safari 18.1 (19619.2.8.111.5, 19619)[arm64]

Suggested Solutions

  • Expand parser to allow any character in the label, possibly supporting escaped brackets

Additional Context

No response

Metadata

Assignees

No one assigned

    Labels

    Status: TriageNeeds to be verified, categorized, etcType: Bug / ErrorSomething isn't working or is incorrect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions