mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-24 17:59:39 +02:00
fix for broken katex,state,error spec
This commit is contained in:
@@ -51,7 +51,7 @@ export const draw = async function (text: string, id: string, _version: string,
|
||||
await render(data4Layout, svg, element);
|
||||
const padding = data4Layout.config.flowchart?.padding ?? 8;
|
||||
utils.insertTitle(
|
||||
element,
|
||||
svg,
|
||||
'flowchartTitleText',
|
||||
conf?.titleTopMargin || 0,
|
||||
diag.db.getDiagramTitle()
|
||||
|
@@ -216,9 +216,13 @@ export const createText = async (
|
||||
|
||||
const htmlText = markdownToHTML(text, config);
|
||||
const decodedReplacedText = replaceIconSubstring(decodeEntities(htmlText));
|
||||
|
||||
//for Katex the text could contain escaped characters, \\relax that should be transformed to \relax
|
||||
const inputForKatex = text.replace(/\\\\/g, '\\');
|
||||
|
||||
const node = {
|
||||
isNode,
|
||||
label: decodedReplacedText,
|
||||
label: hasKatex(text) ? inputForKatex : decodedReplacedText,
|
||||
labelStyle: style.replace('fill:', 'color:'),
|
||||
};
|
||||
const vertexNode = await addHtmlSpan(el, node, width, classes, addSvgBackground);
|
||||
|
Reference in New Issue
Block a user