summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/js/extra.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index d36592d9..df5e454e 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -373,18 +373,10 @@ export function finishView (view) {
var $value = $(value)
const $ele = $(value).closest('pre')
- let mermaidError = null
- window.mermaid.parseError = (err, hash) => {
- mermaidError = err
- }
-
- if (window.mermaidAPI.parse($value.text())) {
- $ele.addClass('mermaid')
- $ele.html($value.text())
- window.mermaid.init(undefined, $ele)
- } else {
- throw new Error(mermaidError)
- }
+ window.mermaid.mermaidAPI.parse($value.text())
+ $ele.addClass('mermaid')
+ $ele.html($value.text())
+ window.mermaid.init(undefined, $ele)
} catch (err) {
$value.unwrap()
$value.parent().append('<div class="alert alert-warning">' + err + '</div>')