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
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
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)
.map((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}
</div>
`
</div>`
: `<div>${line}</div>`
)
.join('')

View File

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