##// END OF EJS Templates
catch js errors when rendering markdown cells
MinRK -
Show More
@@ -388,3 +388,7 b' pre, code, kbd, samp { white-space: pre-wrap; }'
388 #fonttest {
388 #fonttest {
389 font-family: monospace;
389 font-family: monospace;
390 }
390 }
391
392 .render-error {
393 color: darkred;
394 } No newline at end of file
@@ -220,7 +220,15 b' var IPython = (function (IPython) {'
220 var text = this.get_text();
220 var text = this.get_text();
221 if (text === "") { text = this.placeholder; }
221 if (text === "") { text = this.placeholder; }
222 var html = IPython.markdown_converter.makeHtml(text);
222 var html = IPython.markdown_converter.makeHtml(text);
223 this.set_rendered(html);
223 try {
224 this.set_rendered(html);
225 } catch (e) {
226 console.log("Error rendering Markdown:");
227 console.log(e);
228 this.set_rendered($("<div/>").addClass("render-error").html(
229 "Error rendering Markdown!<br/>" + e.toString())
230 );
231 }
224 this.typeset()
232 this.typeset()
225 this.element.find('div.text_cell_input').hide();
233 this.element.find('div.text_cell_input').hide();
226 this.element.find("div.text_cell_render").show();
234 this.element.find("div.text_cell_render").show();
General Comments 0
You need to be logged in to leave comments. Login now