ricklon commited on
Commit
07a370e
·
1 Parent(s): 093c1dd

Preserve OCR line breaks in markdown preview

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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] = {}