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

Class diagram rendering issue for empty class #4954

Closed
anvar-ramazanov opened this issue Oct 18, 2023 · 2 comments
Closed

Class diagram rendering issue for empty class #4954

anvar-ramazanov opened this issue Oct 18, 2023 · 2 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@anvar-ramazanov
Copy link

anvar-ramazanov commented Oct 18, 2023

Description

Version of mermaid: 10.5.0

Hey! I noticed weird behavior during rendering class diagram

This code will be rendered as expected (Live editor)

classDiagram
   class foo {
   }

   class bar {
   }

This code will be rendered as well (Live editor):

classDiagram
   class foo {
   }

   class bar {
newField}

But this one (Live Editor):

classDiagram
   class foo {
   }

   class bar {
}

will be failed with next error:

... } class bar {}
--------------------^
Expecting 'MEMBER', got 'STRUCT_STOP'

Is it by design or it is bug?

Steps to reproduce

Use this code:

   class foo {
   }

   class bar {
}

Screenshots

No response

Code Sample

No response

Setup

  • Mermaid version: 10.5.0
  • Browser and Version: Edge

Suggested Solutions

No response

Additional Context

No response

@anvar-ramazanov anvar-ramazanov added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 18, 2023
@jgreywolf jgreywolf added include roadmap items to add to roadmap for auto workflow and removed include roadmap items to add to roadmap for auto workflow labels Nov 16, 2023
@jgreywolf
Copy link
Contributor

@anvar-ramazanov this is by design. If you want to define a class with no members, then do not use the {...} syntax, and just provide the class name

@anvar-ramazanov
Copy link
Author

@jgreywolf If it by design it could be valuable to add it to public doc?

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

2 participants