diff --git a/.changeset/new-students-brush.md b/.changeset/new-students-brush.md new file mode 100644 index 00000000..159ceba2 --- /dev/null +++ b/.changeset/new-students-brush.md @@ -0,0 +1,5 @@ +--- +'@myst-theme/jupyter': patch +--- + +Fix path of non-ipynb files in thebe diff --git a/packages/jupyter/src/execute/leaf.tsx b/packages/jupyter/src/execute/leaf.tsx index cda43707..7340aa63 100644 --- a/packages/jupyter/src/execute/leaf.tsx +++ b/packages/jupyter/src/execute/leaf.tsx @@ -140,9 +140,10 @@ export function SessionStarter({ // in order to allow for multiple independent sessions of the same notebook let path = `/${pageSlug}-${notebookSlug}.ipynb`; console.debug('session starter path:', path); - const match = location?.match(/(.*)\/.*.ipynb$/) ?? null; + const match = location?.match(/(.*)\/.*/) ?? null; if (match) { console.debug('session starter match:', match); + // Choose an arbitrary suffix, not important path = `${match[1]}/${pageSlug}-${notebookSlug}.ipynb`; console.debug('session starter path (modified):', path); }