diff --git a/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js b/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js index 012d4fb2d..de6f0403d 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/createLabel.js @@ -81,7 +81,7 @@ const createLabel = async (_vertexText, style, isTitle, isNode) => { return vertexNode; } else { const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text'); - svgLabel.setAttribute('style', style ? style.replace('color:', 'fill:') : ''); + svgLabel.setAttribute('style', style.replace('color:', 'fill:')); let rows = []; if (typeof vertexText === 'string') { rows = vertexText.split(/\\n|\n|/gi);