mirror of
https://github.com/zadam/trilium.git
synced 2025-01-14 19:19:28 +08:00
fix content renderer for mermaid
This commit is contained in:
parent
a06ee1ced1
commit
fed5f1a7d2
1 changed files with 3 additions and 2 deletions
|
@ -209,8 +209,9 @@ async function renderMermaid(note, $renderedContent) {
|
|||
mermaid.mermaidAPI.initialize({startOnLoad: false, theme: mermaidTheme.trim(), securityLevel: 'antiscript'});
|
||||
|
||||
try {
|
||||
mermaid.mermaidAPI.render("in-mermaid-graph-" + idCounter++, content,
|
||||
content => $renderedContent.append($(content)));
|
||||
const {svg} = await mermaid.mermaidAPI.render("in-mermaid-graph-" + idCounter++, content);
|
||||
|
||||
$renderedContent.append($(svg));
|
||||
} catch (e) {
|
||||
const $error = $("<p>The diagram could not displayed.</p>");
|
||||
|
||||
|
|
Loading…
Reference in a new issue