diff options
author | Sheogorath | 2017-10-30 07:24:57 +0100 |
---|---|---|
committer | GitHub | 2017-10-30 07:24:57 +0100 |
commit | b3c66d4a100899d72a201ad9e95a137c2ceeccf4 (patch) | |
tree | ae4c5f3062690857a03d20f8663cc859db74699e | |
parent | f1475535a24d7cf61620656378da6bec718dd788 (diff) | |
parent | 09d2ba41cf42841205752b0f127305202218f985 (diff) |
Merge pull request #608 from SISheogorath/fix/mermaid
Use mermaidAPI in mermaid scope
Diffstat (limited to '')
-rw-r--r-- | public/js/extra.js | 16 |
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>') |