@ -15,7 +15,7 @@ var IPython = (function (IPython) {
var CodeCell = function ( notebook ) {
this . code _mirror = null ;
this . input _prompt _number = ' ' ;
this . input _prompt _number = null ;
this . is _completing = false ;
this . completion _cursor = null ;
this . outputs = [ ] ;
@ -611,7 +611,9 @@ var IPython = (function (IPython) {
if ( last . output _type == 'stream' && json . stream == last . stream ) {
// latest output was in the same stream,
// so append directly into its pre tag
this . element . find ( 'div.' + subclass ) . last ( ) . find ( 'pre' ) . append ( json . text ) ;
// escape ANSI & HTML specials:
var text = utils . fixConsole ( json . text ) ;
this . element . find ( 'div.' + subclass ) . last ( ) . find ( 'pre' ) . append ( text ) ;
return ;
}
}
@ -660,6 +662,8 @@ var IPython = (function (IPython) {
CodeCell . prototype . append _text = function ( data , element , extra _class ) {
var toinsert = $ ( "<div/>" ) . addClass ( "box_flex1 output_subarea output_text" ) ;
// escape ANSI & HTML specials in plaintext:
data = utils . fixConsole ( data ) ;
if ( extra _class ) {
toinsert . addClass ( extra _class ) ;
}
@ -766,9 +770,9 @@ var IPython = (function (IPython) {
} ;
CodeCell . prototype . set _input _prompt = function ( number ) {
var n = number || ' ' ;
this . input _prompt _number = n ;
this . element . find ( 'div.input_prompt' ) . html ( 'In [' + n + ']:' ) ;
this . input _prompt _number = number ;
var ns = number || " " ;
this . element . find ( 'div.input_prompt' ) . html ( 'In [' + n s + ']:' ) ;
} ;
@ -829,7 +833,7 @@ var IPython = (function (IPython) {
var data = { } ;
data . input = this . get _text ( ) ;
data . cell _type = 'code' ;
if ( this . input _prompt _number !== ' ' ) {
if ( this . input _prompt _number ) {
data . prompt _number = this . input _prompt _number ;
} ;
var outputs = [ ] ;