broadfield-dev commited on
Commit
0506d95
·
verified ·
1 Parent(s): 28dce47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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 (REVERTED) ---
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
- # The 'xvfb' option has been removed as requested.
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")