Merge pull request #612 from SISheogorath/fix/mermaidErr

Fix mermaid error handling

Fixes #610
This commit is contained in:
Sheogorath 2017-10-30 12:30:38 +01:00 committed by GitHub
commit dad5798472
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -378,9 +378,14 @@ export function finishView (view) {
$ele.html($value.text()) $ele.html($value.text())
window.mermaid.init(undefined, $ele) window.mermaid.init(undefined, $ele)
} catch (err) { } catch (err) {
var errormessage = err
if (err.str) {
errormessage = err.str
}
$value.unwrap() $value.unwrap()
$value.parent().append('<div class="alert alert-warning">' + err + '</div>') $value.parent().append('<div class="alert alert-warning">' + errormessage + '</div>')
console.warn(err) console.warn(errormessage)
} }
}) })
// abc.js // abc.js