openfree commited on
Commit
b3cddd7
·
verified ·
1 Parent(s): 416c3df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -12
app.py CHANGED
@@ -267,24 +267,18 @@ def remove_code_block(text):
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 class="sandbox-wrapper" style="width:100%; height:800px; max-height:800px; overflow:hidden; position:relative;">
276
- <div class="sandbox-container" style="width:100%; height:800px; max-height:800px; overflow:hidden; position:absolute; top:0; left:0; right:0; bottom:0;">
277
- <iframe
278
- src="{data_uri}"
279
- style="width:100%; height:800px; max-height:800px; border:none; display:block;"
280
- scrolling="auto"
281
- sandbox="allow-scripts allow-same-origin"
282
- onload="this.style.height='800px';"
283
- ></iframe>
284
- </div>
285
- </div>
286
  """
287
 
 
288
  theme = gr.themes.Soft()
289
 
290
  def load_json_data():
 
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
+ <iframe
275
+ src="{data_uri}"
276
+ style="width:100%; height:800px; border:none;"
277
+ frameborder="0"
278
+ ></iframe>
 
 
 
 
 
 
279
  """
280
 
281
+
282
  theme = gr.themes.Soft()
283
 
284
  def load_json_data():