Fix actions db (#761)
Go CI / Lint (push) Has been cancelled
Go CI / Check (push) Has been cancelled
Go CI / Test (mysql, 1.26, mysql:8, ubuntu-latest, 3306:3306) (push) Has been cancelled
Go CI / Test (postgres, 1.26, postgres:16, ubuntu-latest, 5432:5432) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, macOS-latest) (push) Has been cancelled
Go CI / Test (sqlite, 1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, macOS-latest) (push) Has been cancelled
Go CI / Build (1.26, ubuntu-latest) (push) Has been cancelled
Go CI / Build (1.26, windows-latest) (push) Has been cancelled

Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
This commit is contained in:
Thomas
2026-07-03 17:06:57 +08:00
committed by GitHub
parent 1720e886eb
commit 64e9c9aa53
4 changed files with 16 additions and 5 deletions
+5 -2
View File
@@ -9,6 +9,9 @@ import DOMPurify from 'dompurify';
// security advisory describing the original markdown-cell / output sinks).
const sanitize = (html: string): string => DOMPurify.sanitize(html);
// nbformat allows `source`/`text` fields to be either a string or an array of strings.
const joinSource = (source: string | string[]): string => Array.isArray(source) ? source.join('') : source || '';
class IPynb {
private element: HTMLElement;
private cells: HTMLElement[] = [];
@@ -54,7 +57,7 @@ class IPynb {
if (output.output_type === 'stream') {
const textElement = document.createElement('pre');
textElement.classList.add('stream-output');
textElement.textContent = output.text.join('');
textElement.textContent = joinSource(output.text);
outputElement.appendChild(textElement);
} else if (output.output_type === 'display_data' || output.output_type === 'execute_result') {
if (output.data['text/plain']) {
@@ -82,7 +85,7 @@ class IPynb {
private createCellElement(cell: any): HTMLElement {
const cellElement = document.createElement('div');
const source = cell.source.join('');
const source = joinSource(cell.source);
cellElement.classList.add('jupyter-cell');
switch (cell.cell_type) {