Spaces:
Runtime error
Runtime error
Use absolute iframe URL when available
Browse files
app.py
CHANGED
|
@@ -319,7 +319,9 @@ def _build_chemiscope_embed(dataset_payload: dict, dataset_path: str | Path) ->
|
|
| 319 |
viewer_path = dataset_file.parent / viewer_name
|
| 320 |
viewer_path.write_text(combined, encoding="utf-8")
|
| 321 |
|
| 322 |
-
|
|
|
|
|
|
|
| 323 |
return (
|
| 324 |
"<div style='width:100%;'>"
|
| 325 |
"<iframe "
|
|
|
|
| 319 |
viewer_path = dataset_file.parent / viewer_name
|
| 320 |
viewer_path.write_text(combined, encoding="utf-8")
|
| 321 |
|
| 322 |
+
view_rel_path = f"/file={urllib.parse.quote(viewer_path.as_posix())}"
|
| 323 |
+
space_origin = _infer_space_origin()
|
| 324 |
+
iframe_src = f"{space_origin}{view_rel_path}" if space_origin else view_rel_path
|
| 325 |
return (
|
| 326 |
"<div style='width:100%;'>"
|
| 327 |
"<iframe "
|