fix: Label in addHtmlSpan

This commit is contained in:
Sidharth Vinod
2025-08-08 12:54:26 +05:30
parent cfc76ef1cb
commit e539909e87

View File

@@ -34,9 +34,9 @@ async function addHtmlSpan(
fo.attr('height', `${10 * width}px`);
const div = fo.append('xhtml:div');
const sanitizedLabel = hasKatex(label)
const sanitizedLabel = hasKatex(node.label)
? await renderKatexSanitized(node.label.replace(common.lineBreakRegex, '\n'), config)
: sanitizeText(label, config);
: sanitizeText(node.label, config);
const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel';
const span = div.append('span');
span.html(sanitizedLabel);