From e807f1b78393a895a3f5c2e5e1f64c7b44dcfc97 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Mon, 30 Oct 2017 11:44:40 +0100 Subject: Fix mermaid error handling --- public/js/extra.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/js/extra.js b/public/js/extra.js index df5e454e..13b8924c 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -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('
' + err + '
') - console.warn(err) + $value.parent().append('
' + errormessage + '
') + console.warn(errormessage) } }) // abc.js -- cgit v1.2.3