Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,10 +7,12 @@ def create_preview_html(svg_path):
|
|
| 7 |
try:
|
| 8 |
with open(svg_path, 'r', encoding='utf-8') as f:
|
| 9 |
svg_content = f.read()
|
| 10 |
-
# SVG를 HTML로 감싸서
|
| 11 |
preview_html = f'''
|
| 12 |
-
<div style="width:100%; height:100%; background-color: white; padding: 20px;">
|
| 13 |
-
|
|
|
|
|
|
|
| 14 |
</div>
|
| 15 |
'''
|
| 16 |
return preview_html
|
|
|
|
| 7 |
try:
|
| 8 |
with open(svg_path, 'r', encoding='utf-8') as f:
|
| 9 |
svg_content = f.read()
|
| 10 |
+
# SVG를 HTML로 감싸서 반환하되, 크기를 제어
|
| 11 |
preview_html = f'''
|
| 12 |
+
<div style="width:100%; height:100%; background-color: white; padding: 20px; max-width: 800px; margin: 0 auto;">
|
| 13 |
+
<div style="width:100%; max-height:600px; overflow:auto;">
|
| 14 |
+
{svg_content.replace('<svg', '<svg style="width:100%; height:auto;"')}
|
| 15 |
+
</div>
|
| 16 |
</div>
|
| 17 |
'''
|
| 18 |
return preview_html
|