@@ -38,8 +38,6 @@ import {
38
38
import { IKernel } from './types' ;
39
39
// tslint:disable-next-line: no-var-requires no-require-imports
40
40
const vscodeNotebookEnums = require ( 'vscode' ) as typeof import ( 'vscode-proposed' ) ;
41
- // tslint:disable-next-line: no-require-imports
42
- import escape = require( 'lodash/escape' ) ;
43
41
44
42
export class CellExecutionFactory {
45
43
constructor (
@@ -458,11 +456,6 @@ export class CellExecution {
458
456
// See this for docs on the messages:
459
457
// https://jupyter-client.readthedocs.io/en/latest/messaging.html#messaging-in-jupyter
460
458
private async handleExecuteResult ( msg : KernelMessage . IExecuteResultMsg , clearState : RefBool ) {
461
- // Escape text output
462
- if ( msg . content . data && msg . content . data . hasOwnProperty ( 'text/plain' ) ) {
463
- msg . content . data [ 'text/plain' ] = escape ( msg . content . data [ 'text/plain' ] as string ) ;
464
- }
465
-
466
459
await this . addToCellData (
467
460
{
468
461
output_type : 'execute_result' ,
@@ -487,7 +480,7 @@ export class CellExecution {
487
480
// Mark as stream output so the text is formatted because it likely has ansi codes in it.
488
481
output_type : 'stream' ,
489
482
// tslint:disable-next-line: no-any
490
- text : escape ( ( o . data as any ) [ 'text/plain' ] . toString ( ) ) ,
483
+ text : ( o . data as any ) [ 'text/plain' ] . toString ( ) ,
491
484
name : 'stdout' ,
492
485
metadata : { } ,
493
486
execution_count : reply . execution_count
@@ -528,11 +521,11 @@ export class CellExecution {
528
521
if ( existing && 'text/plain' in existing . data ) {
529
522
// tslint:disable-next-line:restrict-plus-operands
530
523
existing . data [ 'text/plain' ] = formatStreamText (
531
- concatMultilineString ( `${ existing . data [ 'text/plain' ] } ${ escape ( msg . content . text ) } ` )
524
+ concatMultilineString ( `${ existing . data [ 'text/plain' ] } ${ msg . content . text } ` )
532
525
) ;
533
526
edit . replaceCellOutput ( this . cellIndex , [ ...exitingCellOutput ] ) ; // This is necessary to get VS code to update (for now)
534
527
} else {
535
- const originalText = formatStreamText ( concatMultilineString ( escape ( msg . content . text ) ) ) ;
528
+ const originalText = formatStreamText ( concatMultilineString ( msg . content . text ) ) ;
536
529
// Create a new stream entry
537
530
const output : nbformat . IStream = {
538
531
output_type : 'stream' ,
@@ -545,11 +538,6 @@ export class CellExecution {
545
538
}
546
539
547
540
private async handleDisplayData ( msg : KernelMessage . IDisplayDataMsg , clearState : RefBool ) {
548
- // Escape text output
549
- if ( msg . content . data && msg . content . data . hasOwnProperty ( 'text/plain' ) ) {
550
- msg . content . data [ 'text/plain' ] = escape ( msg . content . data [ 'text/plain' ] as string ) ;
551
- }
552
-
553
541
const output : nbformat . IDisplayData = {
554
542
output_type : 'display_data' ,
555
543
data : msg . content . data ,
0 commit comments