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

Er diagram breaks if add pk/fk or comment #441

Closed
uselessscat opened this issue Oct 10, 2021 · 5 comments
Closed

Er diagram breaks if add pk/fk or comment #441

uselessscat opened this issue Oct 10, 2021 · 5 comments
Labels
bug Something isn't working good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed retained Will not be auto-closed

Comments

@uselessscat
Copy link

Describe the bug
The preview breaks when add a key before a field definition in erDiagram.

To Reproduce
Link to Live Editor: Link

Steps to reproduce the behavior:

  1. Create a new er diagram
  2. Use this example
    erDiagram
    
    Users {
        string email PK
        string name
    }
    
    Users2 {
        string email "comment"
        string name
    }
    
  3. The editor should show tables with overlapped text
  4. If I use both PK and comment in one table, then the editor shows nothing
    erDiagram
    
    Users {
        string email "comment"
        string name PK
    }
    

Expected behavior
Im not sure how this should work. in the documentation it says that I can add a key, but no example of how this will look is provided:

image

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11 Pro 21H2 22000.194
  • Browser: Edge 94.0.992.38
@sidharthv96 sidharthv96 transferred this issue from mermaid-js/mermaid-live-editor Oct 11, 2021
@sidharthv96 sidharthv96 transferred this issue from mermaid-js/mermaid Oct 11, 2021
@sidharthv96 sidharthv96 added bug Something isn't working good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed retained Will not be auto-closed labels Oct 11, 2021
@sidharthv96
Copy link
Member

To reproduce the example

erDiagram
    CAR ||--o{ NAMED-DRIVER : allows
    CAR {
        string allowedDriver FK 'The license of the allowed driver'
        string registrationNumber
        string make
        string model
    }
    PERSON ||--o{ NAMED-DRIVER : is
    PERSON {
        string driversLicense PK 'The license #'
        string firstName
        string lastName
        int age
    }

@durgakiran
Copy link

@sidharthv96 I would like to take look into this if no one is looking.

@sidharthv96
Copy link
Member

Of course @durgakiran !

All issues without active PRs are open for everyone to tackle 😇

@RonaldZielaznicki
Copy link

@durgakiran @sidharthv96 Some information that may help.

mermaid-js/mermaid#2548 (comment)

@sidharthv96
Copy link
Member

sidharthv96 commented Aug 19, 2022

Fixed in mermaid-js/mermaid#3168
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers Hacktoberfest help wanted Extra attention is needed retained Will not be auto-closed
Projects
None yet
Development

No branches or pull requests

4 participants