Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -121,7 +121,7 @@ def build_full_html(markdown_text, styles, include_fontawesome):
|
|
| 121 |
|
| 122 |
return full_html
|
| 123 |
|
| 124 |
-
# --- API ENDPOINT for Conversion (
|
| 125 |
@app.route('/convert', methods=['POST'])
|
| 126 |
def convert_endpoint():
|
| 127 |
data = request.json
|
|
@@ -133,10 +133,11 @@ def convert_endpoint():
|
|
| 133 |
include_fontawesome=data.get('include_fontawesome', False)
|
| 134 |
)
|
| 135 |
|
| 136 |
-
#
|
| 137 |
options = {
|
| 138 |
"quiet": "",
|
| 139 |
'encoding': "UTF-8",
|
|
|
|
| 140 |
}
|
| 141 |
|
| 142 |
temp_html_path = os.path.join(TEMP_DIR, f"{uuid.uuid4()}.html")
|
|
|
|
| 121 |
|
| 122 |
return full_html
|
| 123 |
|
| 124 |
+
# --- API ENDPOINT for Conversion (CHANGED) ---
|
| 125 |
@app.route('/convert', methods=['POST'])
|
| 126 |
def convert_endpoint():
|
| 127 |
data = request.json
|
|
|
|
| 133 |
include_fontawesome=data.get('include_fontawesome', False)
|
| 134 |
)
|
| 135 |
|
| 136 |
+
# This combines the fixes: using xvfb to prevent the ProtocolUnknownError.
|
| 137 |
options = {
|
| 138 |
"quiet": "",
|
| 139 |
'encoding': "UTF-8",
|
| 140 |
+
'xvfb': ''
|
| 141 |
}
|
| 142 |
|
| 143 |
temp_html_path = os.path.join(TEMP_DIR, f"{uuid.uuid4()}.html")
|