Fix text label colors for flow charts

When htmlLabels is set to `false` and a background fill color is used
for a node, the text label will inherit the fill color, hiding the
actual text. To fix this, explicitly set the fill color to `#333`, the
same value used in `src/themes/flowchart.scss`.

Closes https://github.com/knsv/mermaid/issues/885
This commit is contained in:
Stan Hu 2019-07-21 08:19:50 -07:00
parent 95967151ae
commit 83b7163844

View File

@ -78,6 +78,7 @@ export const addVertices = function (vert, g, svgId) {
tspan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve')
tspan.setAttribute('dy', '1em')
tspan.setAttribute('x', '1')
tspan.setAttribute('fill', '#333')
tspan.textContent = rows[j]
svgLabel.appendChild(tspan)
}