Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -267,12 +267,21 @@ def remove_code_block(text):
|
|
267 |
def history_render(history: History):
|
268 |
return gr.update(open=True), history
|
269 |
|
|
|
270 |
def send_to_sandbox(code):
|
271 |
encoded_html = base64.b64encode(code.encode('utf-8')).decode('utf-8')
|
272 |
data_uri = f"data:text/html;charset=utf-8;base64,{encoded_html}"
|
273 |
-
return f"
|
274 |
-
|
275 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
|
277 |
theme = gr.themes.Soft()
|
278 |
|
|
|
267 |
def history_render(history: History):
|
268 |
return gr.update(open=True), history
|
269 |
|
270 |
+
|
271 |
def send_to_sandbox(code):
|
272 |
encoded_html = base64.b64encode(code.encode('utf-8')).decode('utf-8')
|
273 |
data_uri = f"data:text/html;charset=utf-8;base64,{encoded_html}"
|
274 |
+
return f"""
|
275 |
+
<div style="height:800px !important; max-height:800px !important; overflow:hidden !important;">
|
276 |
+
<iframe
|
277 |
+
src="{data_uri}"
|
278 |
+
width="100%"
|
279 |
+
height="800"
|
280 |
+
style="height:800px !important; max-height:800px !important; border:none; overflow:auto;"
|
281 |
+
scrolling="auto"
|
282 |
+
></iframe>
|
283 |
+
</div>
|
284 |
+
"""
|
285 |
|
286 |
theme = gr.themes.Soft()
|
287 |
|