|
|
|
|
@ -202,6 +202,18 @@ var IPython = (function (IPython) {
|
|
|
|
|
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
|
|
|
|
|
this.element.find('div.text_cell_input').hide();
|
|
|
|
|
this.element.find("div.text_cell_render").show();
|
|
|
|
|
var code_snippets = this.element.find("pre > code");
|
|
|
|
|
code_snippets.replaceWith(function () {
|
|
|
|
|
var code = $(this).html();
|
|
|
|
|
/* Substitute br for newlines and for spaces
|
|
|
|
|
before highlighting, since prettify doesn't
|
|
|
|
|
preserve those on all browsers */
|
|
|
|
|
code = code.replace(/(\r\n|\n|\r)/gm, "<br/>");
|
|
|
|
|
code = code.replace(/ /gm, ' ');
|
|
|
|
|
code = prettyPrintOne(code);
|
|
|
|
|
|
|
|
|
|
return '<code class="prettyprint">' + code + '</code>';
|
|
|
|
|
});
|
|
|
|
|
this.rendered = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|