Skip to content

Commit 516f5f1

Browse files
authored
Fix two problems with escaping (#14228)
1 parent a7e758a commit 516f5f1

File tree

4 files changed

+4
-24
lines changed

4 files changed

+4
-24
lines changed

news/2 Fixes/14212.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix interactive debugging starting (trimQuotes error).

news/2 Fixes/14216.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix latex output not showing up without a 'display' call.

src/client/datascience/jupyter/jupyterDebugger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ export class JupyterDebugger implements IJupyterDebugger, ICellHashListener {
474474
const data = outputs[0].data;
475475
if (data && data.hasOwnProperty('text/plain')) {
476476
// tslint:disable-next-line:no-any
477-
return (data as any)['text/plain'];
477+
return concatMultilineString((data as any)['text/plain']);
478478
}
479479
if (outputs[0].output_type === 'stream') {
480480
const stream = outputs[0] as nbformat.IStream;

src/datascience-ui/interactive-common/cellOutput.tsx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -316,22 +316,6 @@ export class CellOutput extends React.Component<ICellOutputProps> {
316316
input = JSON.stringify(output.data);
317317
renderWithScrollbars = true;
318318
isText = true;
319-
} else if (
320-
output.output_type === 'execute_result' &&
321-
input &&
322-
input.hasOwnProperty('text/plain') &&
323-
!input.hasOwnProperty('text/html')
324-
) {
325-
// Plain text should actually be shown as html so that escaped HTML shows up correctly
326-
mimeType = 'text/html';
327-
isText = true;
328-
isError = false;
329-
renderWithScrollbars = true;
330-
// tslint:disable-next-line: no-any
331-
const text = (input as any)['text/plain'];
332-
input = {
333-
'text/html': lodashEscape(concatMultilineString(text))
334-
};
335319
} else if (output.output_type === 'stream') {
336320
mimeType = 'text/html';
337321
isText = true;
@@ -341,7 +325,7 @@ export class CellOutput extends React.Component<ICellOutputProps> {
341325
const stream = output as nbformat.IStream; // NOSONAR
342326
const concatted = lodashEscape(concatMultilineString(stream.text));
343327
input = {
344-
'text/html': concatted // XML tags should have already been escaped.
328+
'text/html': concatted
345329
};
346330

347331
// Output may have ascii colorization chars in it.
@@ -401,12 +385,6 @@ export class CellOutput extends React.Component<ICellOutputProps> {
401385
data = fixMarkdown(concatMultilineString(data as nbformat.MultilineString, true), true);
402386
}
403387

404-
// Make sure text output is escaped (nteract texttransform won't)
405-
if (mimeType === 'text/plain' && data) {
406-
data = lodashEscape(data.toString());
407-
mimeType = 'text/html';
408-
}
409-
410388
return {
411389
isText,
412390
isError,

0 commit comments

Comments
 (0)