DrishtiSharma commited on
Commit
dfda1b6
Β·
verified Β·
1 Parent(s): fa57aa2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -171,6 +171,10 @@ def create_pdf_report_with_viz(report, conclusion, visualizations):
171
 
172
 
173
  def escape_markdown(text):
 
 
 
 
174
  # Escape special markdown characters
175
  escape_chars = r"\*`_{}[]()#+-.!"
176
  return re.sub(f'([{re.escape(escape_chars)}])', r'\\\1', text)
 
171
 
172
 
173
  def escape_markdown(text):
174
+ # Ensure the input is a string
175
+ if not isinstance(text, str):
176
+ text = str(text) if text is not None else ""
177
+
178
  # Escape special markdown characters
179
  escape_chars = r"\*`_{}[]()#+-.!"
180
  return re.sub(f'([{re.escape(escape_chars)}])', r'\\\1', text)