Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -431,8 +431,13 @@ else:
|
|
431 |
bullet_lines = []
|
432 |
for line in rag_answer.splitlines():
|
433 |
if line.strip():
|
434 |
-
|
435 |
-
|
|
|
|
|
|
|
|
|
|
|
436 |
formatted_rag_answer = (
|
437 |
"<div style='background-color: #f0f0f0; padding: 10px;'>"
|
438 |
"<ul style='text-align: left; list-style-position: inside;'>"
|
|
|
431 |
bullet_lines = []
|
432 |
for line in rag_answer.splitlines():
|
433 |
if line.strip():
|
434 |
+
# Remove any markdown bullet markers (e.g. "- " or "* ") from the start of the line
|
435 |
+
line = re.sub(r'^[-*]\s+', '', line.strip())
|
436 |
+
# Convert markdown bold (e.g. **Title [2018.2101.6]**) to HTML <b> tags
|
437 |
+
line = re.sub(r'\*\*(.*?)\*\*', r'<b>\1</b>', line)
|
438 |
+
# Optionally, bold any standalone numbers (if desired)
|
439 |
+
# line = re.sub(r'(\d+)', r'<b>\1</b>', line)
|
440 |
+
bullet_lines.append(f"<li>{line}</li>")
|
441 |
formatted_rag_answer = (
|
442 |
"<div style='background-color: #f0f0f0; padding: 10px;'>"
|
443 |
"<ul style='text-align: left; list-style-position: inside;'>"
|