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

Architecture Diagram error when declaring diagram level "title" #6162

Open
hakanson opened this issue Jan 2, 2025 · 0 comments
Open

Architecture Diagram error when declaring diagram level "title" #6162

hakanson opened this issue Jan 2, 2025 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@hakanson
Copy link

hakanson commented Jan 2, 2025

Description

Using Mermaid Live Editor, an architecture-beta with a title gets this error message

Diagram syntax error
Error: Parsing failed: Expecting token of type ':' but found `test`.
Expecting: one of these possible Token sequences:
1. [--]
2. [-]
but found: 'test'

Steps to reproduce

Use this code - removing title test will render correctly

architecture-beta
    title test
    group api(cloud)[API]

    service db(database)[Database] in api
    service disk1(disk)[Storage] in api
    service disk2(disk)[Storage] in api
    service server(server)[Server] in api

    db:L -- R:server
    disk1:T -- B:server
    disk2:T -- B:db

Screenshots

No response

Code Sample

https://develop.git.mermaid.live/edit#pako:eNqNkDFrxDAMhf-K0ZTAZeiN3lpuKXQod93iG2RbTcwldnDkQjnuv9euUwotlGrQk_Q-g3lXMMESSMBoRsdkOEXqNDEqL3Kx44kE08p1H2JIi8DFNWYKybb9_fPjWflqrhTfnCFhdWORUeNKbX_YprNwvjz8gbr1cteU3vYnDhGHP8D9f8CiFJsqmf3Ub7TCVssn0XXiKCu3Xctn5EsxHn4Z-y_DatjBTHFGZ3Nw14Io4JFmUiDzaDFeFCh_yxwmDqd3b0ByTLSDHN8wgnzFac1bWnJOdHA4RJy36-0DIweGew

Setup

  • Mermaid version: 11.4.1
  • Browser and Version: Edge

Suggested Solutions

I see TitleAndAccessibilities is imported from ../common/common

entry Architecture:
NEWLINE*
"architecture-beta"
(
NEWLINE* TitleAndAccessibilities
| NEWLINE* Statement*
| NEWLINE*
)
;

but guessing the Edge and ARCH_ID regex are greedy matching title

Edge:
lhsId=ARCH_ID lhsGroup?=ARROW_GROUP? Arrow rhsId=ARCH_ID rhsGroup?=ARROW_GROUP? EOL
;
terminal ARROW_DIRECTION: 'L' | 'R' | 'T' | 'B';
terminal ARCH_ID: /[\w]+/;

terminal TITLE: /[\t ]*title(?:[\t ][^\n\r]*?(?=%%)|[\t ][^\n\r]*|)/;

Additional Context

No response

@hakanson hakanson added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Jan 2, 2025
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