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

accDescription fields cause parser errors in Sequence Diagrams #3506

Open
pje opened this issue Sep 22, 2022 · 3 comments
Open

accDescription fields cause parser errors in Sequence Diagrams #3506

pje opened this issue Sep 22, 2022 · 3 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@pje
Copy link
Contributor

pje commented Sep 22, 2022

Describe the bug

Sequence diagrams containing accDescription <foo> or accTitle <foo> cause a parser error.

Several of the sequence diagrams in the demo/ directory have accDescriptions and are currently causing parser errors. For example, demos/sequence.html looks like this currently:

Screen Shot 2022-09-22 at 11 39 14 AM

To Reproduce

sequenceDiagram
  accDescription Test a description
Loading

☝️ the sequence diagram above renders an error at the time this issue was opened. The error looks like this in GitHub's UI.

Expected behavior
accDescription fields should be supported in sequence diagrams. No parser errors should happen when rendering them.

Code Sample

https://mermaid.live/edit#pako:eNpFzrEKwzAMBNBfMZrzBZ7TL2hHLcK6tIZYTm15KCH_3gwp3Y7jcdxOqSooUsd7wBLmLM8mhY1dUprRU8ub52rhge5Bgv4rmqigFcl6DuxsITD5CwVM8YyKRcbqTGzHScem4rhp9tooLrJ2TCTD6_1jiaK3gR-6Tlzq-AIiujrd

Desktop (please complete the following information):

  • OS: macOS
  • Browser Chrome
  • Version 105.0.5195.125 (Official Build) (x86_64)

Additional context

Accessible Descriptions (accDescription) fields were added in #3008.

@pje pje added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Sep 22, 2022
@pje
Copy link
Contributor Author

pje commented Sep 22, 2022

Looking at this further I notice that the accTitle: <foo> syntax parses correctly (note the :) (although it does fail to output a <desc> tag):

sequenceDiagram
  accTitle: foo
sequenceDiagram
  title: foo
  accTitle: foo
Loading

So I guess this issue becomes: which is the correct syntax? accTitle: foo or accTitle foo?

From the grammar file I'd assume that accTitle foo without the colon is preferred, to match the title syntax.

"title"\s[^#\n;]+ return 'title';
"title:"\s[^#\n;]+ return 'legacy_title';

@pje
Copy link
Contributor Author

pje commented Sep 22, 2022

Created a branch with tests for both syntaxes here: https://github.com/pje/mermaid/tree/bug/3506_sequence_accDescription

@weedySeaDragon
Copy link
Contributor

@pje I had a similar question when looking at the demo files (what should the correct syntax be?).
The documentation is clear: there should be a colon after the the keywords: accTitle: and accDescr:

Some of the demo files definitely need to be fixed.

@jgreywolf jgreywolf added roadmap items to add to roadmap for auto workflow and removed roadmap items to add to roadmap for auto workflow labels Nov 16, 2023
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

3 participants