summaryrefslogtreecommitdiff
path: root/public/js
diff options
context:
space:
mode:
authorSheogorath2017-10-28 16:56:25 +0200
committerSheogorath2017-10-30 07:11:14 +0100
commit09d2ba41cf42841205752b0f127305202218f985 (patch)
treeae4c5f3062690857a03d20f8663cc859db74699e /public/js
parentf1475535a24d7cf61620656378da6bec718dd788 (diff)
Use mermaidAPI in mermaid scope
Introduced by https://github.com/knsv/mermaid/commit/a5b71455271aef1180eefa1054d751dea1885e3f#diff-67ae90c5144c55348a3cbdb078240454L532 Fixes #600 Parse only throws error: https://github.com/knsv/mermaid/commit/167368d508f1e5b1606b2b45f892cdd60d479448#diff-67ae90c5144c55348a3cbdb078240454
Diffstat (limited to '')
-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>')