##// END OF EJS Templates
don't preserve fixConsole output in json
MinRK -
Show More
@@ -598,7 +598,9 b' var IPython = (function (IPython) {'
598 if (last.output_type == 'stream' && json.stream == last.stream){
598 if (last.output_type == 'stream' && json.stream == last.stream){
599 // latest output was in the same stream,
599 // latest output was in the same stream,
600 // so append directly into its pre tag
600 // so append directly into its pre tag
601 this.element.find('div.'+subclass).last().find('pre').append(json.text);
601 // escape ANSI & HTML specials:
602 var text = utils.fixConsole(json.text);
603 this.element.find('div.'+subclass).last().find('pre').append(text);
602 return;
604 return;
603 }
605 }
604 }
606 }
@@ -647,6 +649,8 b' var IPython = (function (IPython) {'
647
649
648 CodeCell.prototype.append_text = function (data, element, extra_class) {
650 CodeCell.prototype.append_text = function (data, element, extra_class) {
649 var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_text");
651 var toinsert = $("<div/>").addClass("box_flex1 output_subarea output_text");
652 // escape ANSI & HTML specials in plaintext:
653 data = utils.fixConsole(data);
650 if (extra_class){
654 if (extra_class){
651 toinsert.addClass(extra_class);
655 toinsert.addClass(extra_class);
652 }
656 }
@@ -816,7 +816,7 b' var IPython = (function (IPython) {'
816 var json = {};
816 var json = {};
817 json.output_type = msg_type;
817 json.output_type = msg_type;
818 if (msg_type === "stream") {
818 if (msg_type === "stream") {
819 json.text = utils.fixConsole(content.data);
819 json.text = content.data;
820 json.stream = content.name;
820 json.stream = content.name;
821 } else if (msg_type === "display_data") {
821 } else if (msg_type === "display_data") {
822 json = this.convert_mime_types(json, content.data);
822 json = this.convert_mime_types(json, content.data);
@@ -826,11 +826,7 b' var IPython = (function (IPython) {'
826 } else if (msg_type === "pyerr") {
826 } else if (msg_type === "pyerr") {
827 json.ename = content.ename;
827 json.ename = content.ename;
828 json.evalue = content.evalue;
828 json.evalue = content.evalue;
829 var traceback = [];
829 json.traceback = content.traceback;
830 for (var i=0; i<content.traceback.length; i++) {
831 traceback.push(utils.fixConsole(content.traceback[i]));
832 }
833 json.traceback = traceback;
834 };
830 };
835 cell.append_output(json);
831 cell.append_output(json);
836 this.dirty = true;
832 this.dirty = true;
@@ -839,7 +835,7 b' var IPython = (function (IPython) {'
839
835
840 Notebook.prototype.convert_mime_types = function (json, data) {
836 Notebook.prototype.convert_mime_types = function (json, data) {
841 if (data['text/plain'] !== undefined) {
837 if (data['text/plain'] !== undefined) {
842 json.text = utils.fixConsole(data['text/plain']);
838 json.text = data['text/plain'];
843 };
839 };
844 if (data['text/html'] !== undefined) {
840 if (data['text/html'] !== undefined) {
845 json.html = data['text/html'];
841 json.html = data['text/html'];
General Comments 0
You need to be logged in to leave comments. Login now