fix: Remove space which caused extra newline on diagrams

This commit is contained in:
Sidharth Vinod
2024-03-23 14:59:36 +05:30
parent be37f2c576
commit 45a5424ebf
2 changed files with 3 additions and 6 deletions

View File

@@ -346,11 +346,9 @@ export const renderKatex = async (text: string, config: MermaidConfig): Promise<
.split(lineBreakRegex) .split(lineBreakRegex)
.map((line) => .map((line) =>
hasKatex(line) hasKatex(line)
? ` ? `<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">
<div style="display: flex; align-items: center; justify-content: center; white-space: nowrap;">
${line} ${line}
</div> </div>`
`
: `<div>${line}</div>` : `<div>${line}</div>`
) )
.join('') .join('')

View File

@@ -22,8 +22,7 @@ function addHtmlSpan(element, node, width, classes, addBackground = false) {
const label = node.label; const label = node.label;
const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel'; const labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel';
div.html( div.html(
` `<span class="${labelClass} ${classes}" ` +
<span class="${labelClass} ${classes}" ` +
(node.labelStyle ? 'style="' + node.labelStyle + '"' : '') + (node.labelStyle ? 'style="' + node.labelStyle + '"' : '') +
'>' + '>' +
label + label +