diff --git a/deck.codemirror.js b/deck.codemirror.js index 1941641..c237196 100644 --- a/deck.codemirror.js +++ b/deck.codemirror.js @@ -138,7 +138,15 @@ if (output.html() !== "") { output.append("
" + msg); } else { - output.html(msg); + + // in case the output is not a string or an html element, + // just stringify it. + try { + output.html(msg); + } catch(e) { + output.html(JSON.stringify(msg)); + } + } };