mirror of https://github.com/status-im/codimd.git
Fix mermaid error handling
This commit is contained in:
parent
b3c66d4a10
commit
e807f1b783
|
@ -378,9 +378,14 @@ export function finishView (view) {
|
|||
$ele.html($value.text())
|
||||
window.mermaid.init(undefined, $ele)
|
||||
} catch (err) {
|
||||
var errormessage = err
|
||||
if (err.str) {
|
||||
errormessage = err.str
|
||||
}
|
||||
|
||||
$value.unwrap()
|
||||
$value.parent().append('<div class="alert alert-warning">' + err + '</div>')
|
||||
console.warn(err)
|
||||
$value.parent().append('<div class="alert alert-warning">' + errormessage + '</div>')
|
||||
console.warn(errormessage)
|
||||
}
|
||||
})
|
||||
// abc.js
|
||||
|
|
Loading…
Reference in New Issue