Skip to content

Commit 4054e25

Browse files
committed
ignore jupyter widget related js files
this is caused by the js widgets implementation probing locally before loading the required js from a remote CDN - so no need to display the error.
1 parent a0016ff commit 4054e25

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/core/http.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,18 @@ export function httpFileRequestHandler(
8888
: { print: true, response: { body: encoder.encode("Not Found") } };
8989

9090
// Ignore 404s from specific files
91-
const ignoreFileNames = ["favicon.ico", "listings.json"];
91+
const ignoreFileNames = [
92+
"favicon.ico",
93+
"listings.json",
94+
/jupyter-.*.js/,
95+
];
9296

9397
handle404.print = handle404.print &&
9498
!!options.printUrls &&
9599
(!fsPath || (
96-
!ignoreFileNames.includes(basename(fsPath)) &&
100+
!ignoreFileNames.find((name) => {
101+
return basename(fsPath).match(name);
102+
}) &&
97103
extname(fsPath) !== ".map"
98104
));
99105
if (handle404.print) {

src/core/jupyter/jupyter-embed.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ async function notebookMarkdown(
185185
options,
186186
);
187187

188+
// Wrap any injected cells with a div that includes a back link to
189+
// the notebook that originated the cells
188190
const notebookMarkdown = (cells: JupyterCellOutput[]) => {
189191
const markdown = ["", `:::{notebook="${nbAddress.path}"}`];
190192
markdown.push("");

0 commit comments

Comments
 (0)