Spaces:
Sleeping
Sleeping
riteshraut commited on
Commit ·
1dcbf42
1
Parent(s): 5a97f05
Fix/solve the tts
Browse files
app.py
CHANGED
|
@@ -504,6 +504,11 @@ def clean_markdown_for_tts(text: str) -> str:
|
|
| 504 |
text = re.sub(r'^\s*\d+\.\s+', '', text, flags=re.MULTILINE)
|
| 505 |
# Remove blockquotes (>)
|
| 506 |
text = re.sub(r'^\s*>\s?', '', text, flags=re.MULTILINE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
# Replace multiple newlines with a single space
|
| 508 |
text = re.sub(r'\n+', ' ', text)
|
| 509 |
return text.strip()
|
|
|
|
| 504 |
text = re.sub(r'^\s*\d+\.\s+', '', text, flags=re.MULTILINE)
|
| 505 |
# Remove blockquotes (>)
|
| 506 |
text = re.sub(r'^\s*>\s?', '', text, flags=re.MULTILINE)
|
| 507 |
+
|
| 508 |
+
# --- NEW ADDITION HERE ---
|
| 509 |
+
# Remove horizontal rules (---, ***, ===)
|
| 510 |
+
text = re.sub(r'^\s*[-*_]{3,}\s*$', '', text, flags=re.MULTILINE)
|
| 511 |
+
|
| 512 |
# Replace multiple newlines with a single space
|
| 513 |
text = re.sub(r'\n+', ' ', text)
|
| 514 |
return text.strip()
|