From e3e12bbc78e066f482eae861c57066cdfad3ea16 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Sun, 18 Jun 2023 13:02:35 +0530 Subject: [PATCH] Update `_id` to `id` --- packages/mermaid/src/diagrams/flowchart/flowDb.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.js b/packages/mermaid/src/diagrams/flowchart/flowDb.js index c233d31aa..d17abc3f1 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.js +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.js @@ -209,19 +209,18 @@ export const updateLink = function (positions, style) { }; export const addClass = function (ids, style) { - ids.split(',').forEach(function (_id) { - if (classes[_id] === undefined) { - classes[_id] = { id: _id, styles: [], textStyles: [] }; + ids.split(',').forEach(function (id) { + if (classes[id] === undefined) { + classes[id] = { id, styles: [], textStyles: [] }; } - if (style !== undefined && style !== null) { + if (style) { style.forEach(function (s) { if (s.match('color')) { - const newStyle1 = s.replace('fill', 'bgFill'); - const newStyle2 = newStyle1.replace('color', 'fill'); - classes[_id].textStyles.push(newStyle2); + const newStyle = s.replace('fill', 'bgFill').replace('color', 'fill'); + classes[id].textStyles.push(newStyle); } - classes[_id].styles.push(s); + classes[id].styles.push(s); }); } });