mermaid icon indicating copy to clipboard operation
mermaid copied to clipboard

`erDiagram` doesn't support double percetage (`%%`) comment syntax in attribute blocks

Open Yohe-Am opened this issue 1 year ago • 1 comments

Description

When attempting to use the double percentage sign comment syntax (%%) in attribute blocks of erDiagrams, the following error is thrown:

Error: Parse error on line 6:
... 100 chars" %% this and the foll
----------------------^
Expecting 'BLOCK_STOP', 'ATTRIBUTE_WORD', got '%'

Steps to reproduce

  1. Create a new erDiagram mermaid document.
  2. Use double percentage comment syntax within attribute blocks.
  3. Owl done.

Screenshots

No response

Code Sample

erDiagram
    %% this and the following comment are fine
    %%PRODUCT ||--o{ ORDER-ITEM : "ordered in"
    PRODUCT {
        int id PK
        text title "limit to 100 chars"
        %% this and the following comment break the parser
        %% text desc
    }

Setup

Desktop

  • OS and Version: Linux
  • Browser and Version: Firefox

Additional Context

The error doesn't occur when commenting out entity and relationship declarations.

Yohe-Am avatar Dec 28 '22 13:12 Yohe-Am

Hi I would like to resolve this bug. Can I take up this issue?

kshitijsaksena avatar Feb 20 '23 05:02 kshitijsaksena