Skip to content

Braces in default arguments break mermaid diagrams #312

@sthlm58

Description

@sthlm58

If you generate a mermaid diagram from the following code

class Foo {
public:
    Foo(void* parent = {}) {}
};

int main() {}

You get the following mermaid:

classDiagram
    class C_0017490737515057045975["Foo"]
    class C_0017490737515057045975 {
        +Foo(void * parent = {}) : void
    }

That is invalid with:

Diagram syntax error

Error: Error: Parse error on line 4:
...Foo(void * parent = {}) : void }
-----------------------^
Expecting 'STRUCT_STOP', 'MEMBER', got 'OPEN_IN_STRUCT'

I'm not sure if those { and } characters can be escaped...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions