Skip to content

Commit efe3b1b

Browse files
Alternate method using inline css to hide regular html output in an untrusted notebook (#5880)
* Update formatting_html.py * override inline display:none when css is loaded * remove semicolon Co-authored-by: Illviljan <[email protected]>
1 parent 2422004 commit efe3b1b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

xarray/core/formatting_html.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def _obj_repr(obj, header_components, sections):
255255
"<div>"
256256
f"{icons_svg}<style>{css_style}</style>"
257257
f"<pre class='xr-text-repr-fallback'>{escape(repr(obj))}</pre>"
258-
"<div class='xr-wrap' hidden>"
258+
"<div class='xr-wrap' style='display:none'>"
259259
f"{header}"
260260
f"<ul class='xr-sections'>{sections}</ul>"
261261
"</div>"

xarray/static/css/style.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ body.vscode-dark {
2626
}
2727

2828
.xr-wrap {
29-
display: block;
29+
display: block !important;
3030
min-width: 300px;
3131
max-width: 700px;
3232
}

0 commit comments

Comments
 (0)