mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
add parameter to specify the height of the diagram, fixing #2335
This commit is contained in:
@@ -28,6 +28,7 @@ function render (element, content, theme) {
|
|||||||
})
|
})
|
||||||
mermaidAPI.render(getId(), content, (svgGraph) => {
|
mermaidAPI.render(getId(), content, (svgGraph) => {
|
||||||
element.innerHTML = svgGraph
|
element.innerHTML = svgGraph
|
||||||
|
element.style.height = element.attributes.getNamedItem('data-height').value + 'vh'
|
||||||
})
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class Markdown {
|
|||||||
return `<pre class="chart">${str}</pre>`
|
return `<pre class="chart">${str}</pre>`
|
||||||
}
|
}
|
||||||
if (langType === 'mermaid') {
|
if (langType === 'mermaid') {
|
||||||
return `<pre class="mermaid">${str}</pre>`
|
return `<pre class="mermaid" data-height="${fileName}">${str}</pre>`
|
||||||
}
|
}
|
||||||
return '<pre class="code CodeMirror">' +
|
return '<pre class="code CodeMirror">' +
|
||||||
'<span class="filename">' + fileName + '</span>' +
|
'<span class="filename">' + fileName + '</span>' +
|
||||||
|
|||||||
@@ -383,4 +383,8 @@ modalmonokai()
|
|||||||
width 100%
|
width 100%
|
||||||
background-color $ui-monokai-backgroundColor
|
background-color $ui-monokai-backgroundColor
|
||||||
overflow hidden
|
overflow hidden
|
||||||
border-radius $modal-border-radius
|
border-radius $modal-border-radius
|
||||||
|
|
||||||
|
pre.mermaid svg {
|
||||||
|
max-width 100% !important
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user