From dbe965303bd631c4f3b1582517cd409a21f6dd77 Mon Sep 17 00:00:00 2001 From: saurabhg772244 Date: Tue, 10 Sep 2024 12:10:36 +0530 Subject: [PATCH] Updated logic for vertex label --- cypress/platform/saurabh.html | 2 +- packages/mermaid/src/diagrams/flowchart/flowDb.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cypress/platform/saurabh.html b/cypress/platform/saurabh.html index d355a7d0d..53908e06e 100644 --- a/cypress/platform/saurabh.html +++ b/cypress/platform/saurabh.html @@ -63,7 +63,7 @@
       flowchart LR
-       A --> B2@{ icon: "fa:bell", form: "square", label: "test augfuyfavf ydvaubfuac", pos: "t", h: 400, w: 50 }@ --> C
+       A --> B2@{ icon: "fa:bell", form: "square", label: "B2", pos: "t", h: 400, w: 50 }@ --> C
   
diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.ts b/packages/mermaid/src/diagrams/flowchart/flowDb.ts
index ce9c8415e..8027ec0ec 100644
--- a/packages/mermaid/src/diagrams/flowchart/flowDb.ts
+++ b/packages/mermaid/src/diagrams/flowchart/flowDb.ts
@@ -146,7 +146,7 @@ export const addVertex = function (
     }
     if (doc?.icon) {
       vertex.icon = doc?.icon;
-      if (vertex.text === id) {
+      if (!doc.label) {
         vertex.text = '';
       }
     }
@@ -158,7 +158,7 @@ export const addVertex = function (
     }
     if (doc?.img) {
       vertex.img = doc?.img;
-      if (vertex.text === id) {
+      if (!doc.label) {
         vertex.text = '';
       }
     }