mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Fix composite state with label
This commit is contained in:
parent
fc78ee0fc5
commit
a46f993e3e
@ -301,7 +301,12 @@ export const dataFetcher = (
|
||||
|
||||
// If there's only 1 description entry, just use a regular state shape
|
||||
if (newNode.description?.length === 1 && newNode.shape === SHAPE_STATE_WITH_DESC) {
|
||||
newNode.shape = SHAPE_STATE;
|
||||
if (newNode.type === 'group') {
|
||||
newNode.shape = SHAPE_GROUP;
|
||||
} else {
|
||||
newNode.shape = SHAPE_STATE;
|
||||
}
|
||||
//newNode.shape = SHAPE_STATE;
|
||||
}
|
||||
|
||||
// group
|
||||
|
@ -225,6 +225,13 @@ const extract = (_doc) => {
|
||||
if (Array.isArray(node.label)) {
|
||||
// add the rest as description
|
||||
node.description = node.label.slice(1);
|
||||
if (node.isGroup && node.description.length > 0) {
|
||||
throw new Error(
|
||||
'Group nodes can only have label. Remove the additional description for node [' +
|
||||
node.id +
|
||||
']'
|
||||
);
|
||||
}
|
||||
// add first description as label
|
||||
node.label = node.label[0];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user