Also fix for error handling when setting mermaid.parseError

This commit is contained in:
Knut Sveidqvist
2020-06-06 12:42:35 +02:00
parent 22b0ddfb42
commit 85a8feec9d
24 changed files with 783 additions and 772 deletions

View File

@@ -98,6 +98,7 @@ const init = function() {
.trim()
.replace(/<br\s*\/?>/gi, '<br/>');
try {
mermaidAPI.render(
id,
txt,
@@ -110,6 +111,13 @@ const init = function() {
},
element
);
} catch (e) {
logger.warn('Syntax Error rendering');
logger.warn(e);
if (this.parseError) {
this.parseError(e);
}
}
}
};