fix for broken katex,state,error spec

This commit is contained in:
Ashish Jain
2024-07-18 16:24:59 +02:00
parent 09c5c62e07
commit 138ee49943
5 changed files with 17 additions and 10 deletions

View File

@@ -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()

View File

@@ -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);