mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-11-02 20:04:14 +01:00
fix: htmlLabels resolution for flowchart diagrams
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -21,7 +21,13 @@ export const diagram = {
|
||||
if (cnf.layout) {
|
||||
setConfig({ layout: cnf.layout });
|
||||
}
|
||||
cnf.flowchart.htmlLabels = cnf?.htmlLabels ?? cnf.flowchart?.htmlLabels;
|
||||
cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;
|
||||
setConfig({ flowchart: { arrowMarkerAbsolute: cnf.arrowMarkerAbsolute } });
|
||||
setConfig({
|
||||
flowchart: {
|
||||
arrowMarkerAbsolute: cnf.arrowMarkerAbsolute,
|
||||
htmlLabels: cnf.flowchart.htmlLabels,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { getConfig } from '../../diagram-api/diagramAPI.js';
|
||||
import { evaluate } from '../../diagrams/common/common.js';
|
||||
import { log } from '../../logger.js';
|
||||
import { createText } from '../createText.js';
|
||||
import utils from '../../utils.js';
|
||||
@@ -45,8 +44,8 @@ export const getLabelStyles = (styleArray) => {
|
||||
};
|
||||
|
||||
export const insertEdgeLabel = async (elem, edge) => {
|
||||
let useHtmlLabels = evaluate(getConfig().flowchart.htmlLabels);
|
||||
|
||||
const config = getConfig();
|
||||
let useHtmlLabels = config.flowchart.htmlLabels;
|
||||
const { labelStyles } = styles2String(edge);
|
||||
edge.labelStyle = labelStyles;
|
||||
const labelElement = await createText(elem, edge.label, {
|
||||
|
||||
Reference in New Issue
Block a user