mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-09 18:39:41 +02:00
#958 Cannot center-justify text in nodes
- assign text-align style to text node to allow aligning of node text
This commit is contained in:
@@ -36,9 +36,10 @@ export const addVertices = function(vert, g, svgId) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// create the style definition for the text, if property is a text-property
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
if (typeof arr[i] !== 'undefined') {
|
||||
if (arr[i].match('^color:')) styleStr = styleStr + arr[i] + ';';
|
||||
if (arr[i].match('^color:|^text-align:')) styleStr = styleStr + arr[i] + ';';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user