mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 13:29:40 +02:00
Fix for classDiagram-v2 support for generics using '~' & method emphasis
This commit is contained in:
@@ -672,7 +672,10 @@ const class_box = (parent, node) => {
|
|||||||
}
|
}
|
||||||
const classAttributes = [];
|
const classAttributes = [];
|
||||||
node.classData.members.forEach((str) => {
|
node.classData.members.forEach((str) => {
|
||||||
const parsedText = parseMember(str).displayText;
|
let parsedText = parseMember(str).displayText;
|
||||||
|
if (getConfig().flowchart.htmlLabels) {
|
||||||
|
parsedText = parsedText.replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
}
|
||||||
const lbl = labelContainer
|
const lbl = labelContainer
|
||||||
.node()
|
.node()
|
||||||
.appendChild(createLabel(parsedText, node.labelStyle, true, true));
|
.appendChild(createLabel(parsedText, node.labelStyle, true, true));
|
||||||
@@ -695,10 +698,21 @@ const class_box = (parent, node) => {
|
|||||||
|
|
||||||
const classMethods = [];
|
const classMethods = [];
|
||||||
node.classData.methods.forEach((str) => {
|
node.classData.methods.forEach((str) => {
|
||||||
const parsedText = parseMember(str).displayText;
|
const parsedInfo = parseMember(str);
|
||||||
|
let displayText =parsedInfo.displayText;
|
||||||
|
if (getConfig().flowchart.htmlLabels) {
|
||||||
|
displayText = displayText.replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
}
|
||||||
const lbl = labelContainer
|
const lbl = labelContainer
|
||||||
.node()
|
.node()
|
||||||
.appendChild(createLabel(parsedText, node.labelStyle, true, true));
|
.appendChild(
|
||||||
|
createLabel(
|
||||||
|
displayText,
|
||||||
|
parsedInfo.cssStyle ? parsedInfo.cssStyle : node.labelStyle,
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
);
|
||||||
let bbox = lbl.getBBox();
|
let bbox = lbl.getBBox();
|
||||||
if (evaluate(getConfig().flowchart.htmlLabels)) {
|
if (evaluate(getConfig().flowchart.htmlLabels)) {
|
||||||
const div = lbl.children[0];
|
const div = lbl.children[0];
|
||||||
|
Reference in New Issue
Block a user