Skip to content

[ER Diagram] parsing error when using 1 as identifier in right side of relationship that uses the 1 cardinality alias #7472

@DavidSeptimus

Description

@DavidSeptimus

Description

When using 1 as an entity identifier and referencing it as the right-side operand of a relationship in an ER Diagram, the parser throws an error.

Steps to reproduce

  1. Create a ER diagram relationship where the right side is 1 1
  2. Parser throws an error

Screenshots

Image

Code Sample

erDiagram

a many to 1 1: label

https://develop.git.mermaid.live/edit#pako:eNo9j0tuxCAQRK-Ces1YgBnz2SbbXCBi0wkdjxUDI4KlmVi-exzns6sq6VWpVngtkcAD1ccJx4op5JCRJcx31gqTTHo24wvNwGGsUwTf6kIcEtWE3xbWkBkL0C6UKIDfZcT6HiDkbWeumJ9LSX9YLct4Af-G88fulmvERr_D_2mlHKk-lCU38O6oAL_CDbx0olNqsFaJwSirNYc7-JNUurNnI3ulrRXOWLtx-DxWRadNL1x_Hpwy1kgjOVCcWqlPP7-P-9sXSWdP2g

Setup

  • Mermaid version: 11.13.0
  • Browser and Version: Chrome 145.0.7632.160

Suggested Solutions

No response

Additional Context

This issue is introduced in 11.13.0. I haven't read the source for the two changes (#7375 and #6984) that may affect this behavior to give a definitive root cause. It could also be some combination of the two changes.

Prior to 11.13.0 1 would not have been a valid entity identifier since it was reserved for the 1 cardinality alias.

Left side 1 1 as in 1 1 to many SomeEntity is not affected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions