Fix for node with wrong type

This commit is contained in:
Knut Sveidqvist
2021-11-30 20:28:51 +01:00
parent a018789026
commit 3526e35012
10 changed files with 62 additions and 30 deletions

View File

@@ -19,11 +19,13 @@ export const labelHelper = (parent, node, _classes, isNode) => {
// Create the label and insert it after the rect
const label = shapeSvg.insert('g').attr('class', 'label').attr('style', node.labelStyle);
const labelText = typeof node.labelText === 'string' ? node.labelText:node.labelText[0];
const text = label
.node()
.appendChild(
createLabel(
sanitizeText(decodeEntities(node.labelText), getConfig()),
sanitizeText(decodeEntities(labelText), getConfig()),
node.labelStyle,
false,
isNode