GeezerVison is showing github.com — fix(web): notebook preview shows outputs that carry only text/markdow… · patroza/t3code@fc1f1ba
File treeExpand file treeCollapse file tree Open diff view settings apps/web/src/components/files
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/files/FilePreviewPanel.test.ts +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -403,6 +403,8 @@ Third}`; | 403 | 403 | text: ["\r 10%|# |", "\r100%|##########|\n", "done\r\n", "🚀 ready\rX\n"], | 404 | 404 | }, | 405 | 405 | { data: { "text/html": ["<b>Results</b>"], "text/plain": ["Results"] } }, | | 406 | + { output_type: "display_data", data: { "text/markdown": ["| a |\n", "|---|"] } }, | | 407 | + { data: { "text/plain": "plain wins", "text/markdown": "**markdown**" } }, | 406 | 408 | ], | 407 | 409 | }, | 408 | 410 | ], | @@ -424,6 +426,8 @@ Third}`; | 424 | 426 | { kind: "text", text: "42\n" }, | 425 | 427 | { kind: "text", text: "100%|##########|\ndone\nX ready\n" }, | 426 | 428 | { kind: "html", text: "<b>Results</b>" }, | | 429 | + { kind: "text", text: "| a |\n|---|" }, | | 430 | + { kind: "text", text: "plain wins" }, | 427 | 431 | ], | 428 | 432 | }, | 429 | 433 | ], | |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/files/extendedDocumentPreview.ts +6-1Lines changed: 6 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -530,7 +530,12 @@ export function openNotebook(bytes: ArrayBuffer): OfficeWorkerResult { | 530 | 530 | const html = notebookText(data["text/html"]); | 531 | 531 | if (html.trim() && htmlImagesFit(html)) return { kind: "html" as const, text: html }; | 532 | 532 | const plain = terminalOutputPlainText( | 533 | | - notebookText(output.text ?? data["text/plain"] ?? tracebackLines(output.traceback)), | | 533 | + notebookText( | | 534 | + output.text ?? | | 535 | + data["text/plain"] ?? | | 536 | + data["text/markdown"] ?? | | 537 | + tracebackLines(output.traceback), | | 538 | + ), | 534 | 539 | ); | 535 | 540 | const text = | 536 | 541 | output.output_type === "stream" ? terminalOutputCollapseRedraws(plain) : plain; | |
|