Update app.py
Browse files
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)
|