Spaces:
Running
Running
fix
Browse files
app.py
CHANGED
@@ -1084,8 +1084,16 @@ This will help me create a better design for you."""
|
|
1084 |
# Deploy to Spaces logic
|
1085 |
|
1086 |
def wrap_html_in_gradio_app(html_code):
|
1087 |
-
#
|
1088 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1089 |
|
1090 |
def deploy_to_spaces(code):
|
1091 |
if not code or not code.strip():
|
|
|
1084 |
# Deploy to Spaces logic
|
1085 |
|
1086 |
def wrap_html_in_gradio_app(html_code):
|
1087 |
+
# Escape triple quotes for safe embedding
|
1088 |
+
safe_html = html_code.replace('"""', r'\"\"\"')
|
1089 |
+
return (
|
1090 |
+
'import gradio as gr\n\n'
|
1091 |
+
'def show_html():\n'
|
1092 |
+
f' return """{safe_html}"""\n\n'
|
1093 |
+
'demo = gr.Interface(fn=show_html, inputs=None, outputs=gr.HTML())\n\n'
|
1094 |
+
'if __name__ == "__main__":\n'
|
1095 |
+
' demo.launch()\n'
|
1096 |
+
)
|
1097 |
|
1098 |
def deploy_to_spaces(code):
|
1099 |
if not code or not code.strip():
|