From 4db6d258ad074a483bddfbcf6d8c1617b3d65057 Mon Sep 17 00:00:00 2001 From: rchiodo Date: Fri, 2 Oct 2020 10:23:51 -0700 Subject: [PATCH] Fix two problems with escaping --- news/2 Fixes/14212.md | 1 + news/2 Fixes/14216.md | 1 + .../datascience/jupyter/jupyterDebugger.ts | 2 +- .../interactive-common/cellOutput.tsx | 24 +------------------ 4 files changed, 4 insertions(+), 24 deletions(-) create mode 100644 news/2 Fixes/14212.md create mode 100644 news/2 Fixes/14216.md diff --git a/news/2 Fixes/14212.md b/news/2 Fixes/14212.md new file mode 100644 index 000000000000..97b17eefe462 --- /dev/null +++ b/news/2 Fixes/14212.md @@ -0,0 +1 @@ +Fix interactive debugging starting (trimQuotes error). \ No newline at end of file diff --git a/news/2 Fixes/14216.md b/news/2 Fixes/14216.md new file mode 100644 index 000000000000..8dfd8ad1ba21 --- /dev/null +++ b/news/2 Fixes/14216.md @@ -0,0 +1 @@ +Fix latex output not showing up without a 'display' call. \ No newline at end of file diff --git a/src/client/datascience/jupyter/jupyterDebugger.ts b/src/client/datascience/jupyter/jupyterDebugger.ts index afa7df942137..3d04d70c14af 100644 --- a/src/client/datascience/jupyter/jupyterDebugger.ts +++ b/src/client/datascience/jupyter/jupyterDebugger.ts @@ -474,7 +474,7 @@ export class JupyterDebugger implements IJupyterDebugger, ICellHashListener { const data = outputs[0].data; if (data && data.hasOwnProperty('text/plain')) { // tslint:disable-next-line:no-any - return (data as any)['text/plain']; + return concatMultilineString((data as any)['text/plain']); } if (outputs[0].output_type === 'stream') { const stream = outputs[0] as nbformat.IStream; diff --git a/src/datascience-ui/interactive-common/cellOutput.tsx b/src/datascience-ui/interactive-common/cellOutput.tsx index 33cea77eecbb..fe9467110940 100644 --- a/src/datascience-ui/interactive-common/cellOutput.tsx +++ b/src/datascience-ui/interactive-common/cellOutput.tsx @@ -316,22 +316,6 @@ export class CellOutput extends React.Component { input = JSON.stringify(output.data); renderWithScrollbars = true; isText = true; - } else if ( - output.output_type === 'execute_result' && - input && - input.hasOwnProperty('text/plain') && - !input.hasOwnProperty('text/html') - ) { - // Plain text should actually be shown as html so that escaped HTML shows up correctly - mimeType = 'text/html'; - isText = true; - isError = false; - renderWithScrollbars = true; - // tslint:disable-next-line: no-any - const text = (input as any)['text/plain']; - input = { - 'text/html': lodashEscape(concatMultilineString(text)) - }; } else if (output.output_type === 'stream') { mimeType = 'text/html'; isText = true; @@ -341,7 +325,7 @@ export class CellOutput extends React.Component { const stream = output as nbformat.IStream; // NOSONAR const concatted = lodashEscape(concatMultilineString(stream.text)); input = { - 'text/html': concatted // XML tags should have already been escaped. + 'text/html': concatted }; // Output may have ascii colorization chars in it. @@ -401,12 +385,6 @@ export class CellOutput extends React.Component { data = fixMarkdown(concatMultilineString(data as nbformat.MultilineString, true), true); } - // Make sure text output is escaped (nteract texttransform won't) - if (mimeType === 'text/plain' && data) { - data = lodashEscape(data.toString()); - mimeType = 'text/html'; - } - return { isText, isError,