Skip to content

Commit a8bd87e

Browse files
SVG Display issue (#8881)
1 parent 4be1c61 commit a8bd87e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

news/2 Fixes/8600.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix display of SVG images from previously executed ipynb files.

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,18 @@ export class CellOutput extends React.Component<ICellOutputProps> {
246246
try {
247247
const mimeBundle = copy.data as nbformat.IMimeBundle;
248248
let data: nbformat.MultilineString | JSONObject = mimeBundle[mimeType];
249+
// For un-executed output we might get text or svg output as multiline string arrays
250+
// we want to concat those so we don't display a bunch of weird commas as we expect
251+
// Single strings in our output
252+
if (Array.isArray(data)) {
253+
data = concatMultilineStringOutput(data as nbformat.MultilineString);
254+
}
249255

250256
// Text based mimeTypes don't get a white background
251257
if (/^text\//.test(mimeType)) {
252258
return {
253259
mimeType,
254-
data: concatMultilineStringOutput(data as nbformat.MultilineString),
260+
data,
255261
isText,
256262
isError,
257263
renderWithScrollbars: true,

0 commit comments

Comments
 (0)