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

Regression in class diagram note newlines #6126

Open
bollwyvl opened this issue Dec 12, 2024 · 0 comments
Open

Regression in class diagram note newlines #6126

bollwyvl opened this issue Dec 12, 2024 · 0 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@bollwyvl
Copy link
Contributor

Description

The very first diagram example on https://mermaid.js.org/syntax/classDiagram.html shows explicit \n instead of newlines. The git editor shows the same

Steps to reproduce

  • Visit the docs
  • see the broken note

Screenshots

image

Code Sample

---
title: Animal example
---
classDiagram
    note "From Duck till Zebra"
    Animal <|-- Duck
    note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
    Animal <|-- Fish
    Animal <|-- Zebra
    Animal : +int age
    Animal : +String gender
    Animal: +isMammal()
    Animal: +mate()
    class Duck{
        +String beakColor
        +swim()
        +quack()
    }
    class Fish{
        -int sizeInFeet
        -canEat()
    }
    class Zebra{
        +bool is_wild
        +run()
    }

As rendered by GitHub (with whatever that version is):


title: Animal example

classDiagram
note "From Duck till Zebra"
Animal <|-- Duck
note for Duck "can fly\ncan swim\ncan dive\ncan help in debugging"
Animal <|-- Fish
Animal <|-- Zebra
Animal : +int age
Animal : +String gender
Animal: +isMammal()
Animal: +mate()
class Duck{
+String beakColor
+swim()
+quack()
}
class Fish{
-int sizeInFeet
-canEat()
}
class Zebra{
+bool is_wild
+run()
}

Setup

  • Mermaid version: docs/git editor
  • Browser and Version: [Chrome, Edge, Firefox] yes

Suggested Solutions

  • haven't looked

Additional Context

discovered when trying to update to 11.x from 10.x:

+    "@mermaid-js/layout-elk": ^0.1.7
-    mermaid: ^10.7.0
+    mermaid: ^11.4.1
+"@mermaid-js/layout-elk@npm:^0.1.7":
+  resolution: "@mermaid-js/layout-elk@npm:0.1.7"
+    mermaid: ^11.0.0
+"@mermaid-js/parser@npm:^0.3.0":
+  resolution: "@mermaid-js/parser@npm:0.3.0"
-"mermaid@npm:^10.7.0":
-  resolution: "mermaid@npm:10.9.3"
+"mermaid@npm:^11.4.1":
+  resolution: "mermaid@npm:11.4.1"
+    "@mermaid-js/parser": ^0.3.0
@bollwyvl bollwyvl added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Dec 12, 2024
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

1 participant