mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-06 07:39:48 +02:00
Fix for node with wrong type
This commit is contained in:
20
dist/mermaid.js
vendored
20
dist/mermaid.js
vendored
@@ -24161,7 +24161,11 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
|
||||
if (nodeDb[node.id].description === node.id) {
|
||||
// If the previous description was the is, remove it
|
||||
nodeDb[node.id].description = [node.description];
|
||||
if (Array.isArray(node.description)) {
|
||||
nodeDb[node.id].description = node.description;
|
||||
} else {
|
||||
nodeDb[node.id].description = [node.description];
|
||||
}
|
||||
} else {
|
||||
nodeDb[node.id].description = [nodeDb[node.id].description, node.description];
|
||||
}
|
||||
@@ -24170,8 +24174,6 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
nodeDb[node.id].description = node.description;
|
||||
}
|
||||
}
|
||||
|
||||
nodeDb[node.id].description = _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].sanitizeTextOrArray(nodeDb[node.id].description, (0,_config__WEBPACK_IMPORTED_MODULE_6__.getConfig)());
|
||||
} // Save data for description and group so that for instance a statement without description overwrites
|
||||
// one with description
|
||||
// group
|
||||
@@ -24185,10 +24187,18 @@ var setupNode = function setupNode(g, parent, node, altFlag) {
|
||||
nodeDb[node.id].classes = nodeDb[node.id].classes + ' ' + (altFlag ? 'statediagram-cluster statediagram-cluster-alt' : 'statediagram-cluster');
|
||||
}
|
||||
|
||||
var nodeShape = nodeDb[node.id].shape;
|
||||
var nodeLabelText = nodeDb[node.id].description;
|
||||
|
||||
if (Array.isArray(nodeLabelText) && nodeLabelText.length == 1) {
|
||||
nodeShape = 'rect';
|
||||
nodeLabelText = nodeLabelText[0];
|
||||
}
|
||||
|
||||
var nodeData = {
|
||||
labelStyle: '',
|
||||
shape: nodeDb[node.id].shape,
|
||||
labelText: nodeDb[node.id].description,
|
||||
shape: nodeShape,
|
||||
labelText: nodeLabelText,
|
||||
// typeof nodeDb[node.id].description === 'object'
|
||||
// ? nodeDb[node.id].description[0]
|
||||
// : nodeDb[node.id].description,
|
||||
|
Reference in New Issue
Block a user