diff --git a/packages/mermaid/src/diagrams/flowchart/flowDb.js b/packages/mermaid/src/diagrams/flowchart/flowDb.js index 5aa203225..4a3fd5e9c 100644 --- a/packages/mermaid/src/diagrams/flowchart/flowDb.js +++ b/packages/mermaid/src/diagrams/flowchart/flowDb.js @@ -456,8 +456,8 @@ export const defaultStyle = function () { export const addSubGraph = function (_id, list, _title) { // console.log('addSubGraph', _id, list, _title); let id = _id.trim(); - let title = _title; - if (_id === _title && _title.match(/\s/)) { + let title = _title.trim(); + if (id === title && title.match(/\s/)) { id = undefined; } /** @param a */