Skip to content

Commit 4bb0660

Browse files
Fix notebook opening in a new tab
1 parent a9efe4f commit 4bb0660

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

jupyterlite_sphinx/jupyterlite_sphinx.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ def __init__(
129129
options = "&".join(
130130
[f"{key}={quote(value)}" for key, value in lite_options.items()]
131131
)
132-
self.lab_src = f'{prefix}/{app_path}{f"?{options}" if options else ""}'
132+
self.lab_src = (
133+
f'{prefix}/{app_path}{f"index.html?{options}" if options else ""}'
134+
)
133135

134136
super().__init__(
135137
rawsource,
@@ -170,7 +172,7 @@ def __init__(
170172
[f"{key}={quote(value)}" for key, value in lite_options.items()]
171173
)
172174

173-
iframe_src = f'{prefix}/{app_path}{f"?{options}" if options else ""}'
175+
iframe_src = f'{prefix}/{app_path}{f"index.html?{options}" if options else ""}'
174176

175177
if "iframe_src" in attributes:
176178
if attributes["iframe_src"] != iframe_src:
@@ -246,7 +248,7 @@ def __init__(
246248
[f"{key}={quote(value)}" for key, value in lite_options.items()]
247249
)
248250

249-
iframe_src = f'{prefix}/{app_path}{f"?{options}" if options else ""}'
251+
iframe_src = f'{prefix}/{app_path}{f"index.html?{options}" if options else ""}'
250252

251253
super().__init__(rawsource, *children, iframe_src=iframe_src, **attributes)
252254

0 commit comments

Comments
 (0)