mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-10 17:49:40 +02:00
#5237 Fixes after visual testing. Handling multi-line notes and positioning of notes relative to the state
This commit is contained in:
@@ -328,6 +328,7 @@ export const dataFetcher = (parent, parsedItem, diagramStates, nodes, edges, alt
|
|||||||
look,
|
look,
|
||||||
position: parsedItem.note.position,
|
position: parsedItem.note.position,
|
||||||
};
|
};
|
||||||
|
const parentNodeId = itemId + PARENT_ID;
|
||||||
const groupData = {
|
const groupData = {
|
||||||
labelStyle: '',
|
labelStyle: '',
|
||||||
shape: SHAPE_NOTEGROUP,
|
shape: SHAPE_NOTEGROUP,
|
||||||
@@ -344,12 +345,11 @@ export const dataFetcher = (parent, parsedItem, diagramStates, nodes, edges, alt
|
|||||||
};
|
};
|
||||||
graphItemCount++;
|
graphItemCount++;
|
||||||
|
|
||||||
const parentNodeId = itemId + PARENT_ID;
|
|
||||||
|
|
||||||
//add parent id to groupData
|
//add parent id to groupData
|
||||||
groupData.id = parentNodeId;
|
groupData.id = parentNodeId;
|
||||||
//add parent id to noteData
|
//add parent id to noteData
|
||||||
noteData.parentId = parentNodeId;
|
noteData.parentId = parentNodeId;
|
||||||
|
nodeData.parentId = parentNodeId;
|
||||||
|
|
||||||
//insert groupData
|
//insert groupData
|
||||||
insertOrUpdateNode(nodes, groupData);
|
insertOrUpdateNode(nodes, groupData);
|
||||||
|
@@ -198,16 +198,7 @@ export const createText = (
|
|||||||
} = {},
|
} = {},
|
||||||
config: MermaidConfig
|
config: MermaidConfig
|
||||||
) => {
|
) => {
|
||||||
log.info(
|
log.info('createText', text, style, isTitle, classes, useHtmlLabels, isNode, addSvgBackground);
|
||||||
'createText XEX',
|
|
||||||
text,
|
|
||||||
style,
|
|
||||||
isTitle,
|
|
||||||
classes,
|
|
||||||
useHtmlLabels,
|
|
||||||
isNode,
|
|
||||||
addSvgBackground
|
|
||||||
);
|
|
||||||
if (useHtmlLabels) {
|
if (useHtmlLabels) {
|
||||||
// TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
|
// TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that?
|
||||||
|
|
||||||
|
@@ -75,6 +75,8 @@ export function markdownToHTML(markdown: string, { markdownAutoWrap }: MermaidCo
|
|||||||
return `<em>${node.children.map(output).join('')}</em>`;
|
return `<em>${node.children.map(output).join('')}</em>`;
|
||||||
} else if (node.type === 'paragraph') {
|
} else if (node.type === 'paragraph') {
|
||||||
return `<p>${node.children.map(output).join('')}</p>`;
|
return `<p>${node.children.map(output).join('')}</p>`;
|
||||||
|
} else if (node.type === 'html' && /^<br\s*\/?>$/i.test(node.value)) {
|
||||||
|
return `${node.value}`;
|
||||||
}
|
}
|
||||||
return `Unsupported markdown: ${node.type}`;
|
return `Unsupported markdown: ${node.type}`;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user