diff --git a/IPython/frontend/html/notebook/static/css/notebook.css b/IPython/frontend/html/notebook/static/css/notebook.css index 8a49a19..adc5bff 100644 --- a/IPython/frontend/html/notebook/static/css/notebook.css +++ b/IPython/frontend/html/notebook/static/css/notebook.css @@ -388,3 +388,7 @@ pre, code, kbd, samp { white-space: pre-wrap; } #fonttest { font-family: monospace; } + +.render-error { + color: darkred; +} \ No newline at end of file diff --git a/IPython/frontend/html/notebook/static/js/textcell.js b/IPython/frontend/html/notebook/static/js/textcell.js index 3d07d3a..40a3950 100644 --- a/IPython/frontend/html/notebook/static/js/textcell.js +++ b/IPython/frontend/html/notebook/static/js/textcell.js @@ -220,7 +220,15 @@ var IPython = (function (IPython) { var text = this.get_text(); if (text === "") { text = this.placeholder; } var html = IPython.markdown_converter.makeHtml(text); - this.set_rendered(html); + try { + this.set_rendered(html); + } catch (e) { + console.log("Error rendering Markdown:"); + console.log(e); + this.set_rendered($("
").addClass("render-error").html( + "Error rendering Markdown!
" + e.toString()) + ); + } this.typeset() this.element.find('div.text_cell_input').hide(); this.element.find("div.text_cell_render").show();