mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-09 09:09:38 +02:00
fix: Remove space which caused extra newline on diagrams
This commit is contained in:
@@ -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('')
|
||||||
|
@@ -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 +
|
||||||
|
Reference in New Issue
Block a user