Spaces:
Running on Zero
Running on Zero
Preserve OCR line breaks in markdown preview
Browse files
app.py
CHANGED
|
@@ -205,7 +205,7 @@ def to_math_html(text: str) -> str:
|
|
| 205 |
text = re.sub(r'\\\((.+?)\\\)', inline_math, text)
|
| 206 |
|
| 207 |
# Run markdown on text that now contains only safe placeholder tokens
|
| 208 |
-
html = md_lib.markdown(text, extensions=['tables', 'fenced_code', 'sane_lists'])
|
| 209 |
|
| 210 |
# Protect rendered code/pre blocks so placeholder swap never mutates literal code.
|
| 211 |
protected_blocks: dict[str, str] = {}
|
|
|
|
| 205 |
text = re.sub(r'\\\((.+?)\\\)', inline_math, text)
|
| 206 |
|
| 207 |
# Run markdown on text that now contains only safe placeholder tokens
|
| 208 |
+
html = md_lib.markdown(text, extensions=['tables', 'fenced_code', 'sane_lists', 'nl2br'])
|
| 209 |
|
| 210 |
# Protect rendered code/pre blocks so placeholder swap never mutates literal code.
|
| 211 |
protected_blocks: dict[str, str] = {}
|