Spaces:
Running
Running
clean up design
Browse files
app.py
CHANGED
|
@@ -49,7 +49,9 @@ def postfilters_ok(md_text: str, require_has_table: bool | None, require_has_cod
|
|
| 49 |
return True
|
| 50 |
|
| 51 |
def format_for_markdown(text: str) -> str:
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
def find_next_valid(docs_cache, reader_iter, start_idx: int, require_has_math: bool | None, require_has_infobox: bool | None, require_has_table: bool | None, require_has_code: bool | None):
|
| 55 |
# Scan cache first (forward from start_idx)
|
|
|
|
| 49 |
return True
|
| 50 |
|
| 51 |
def format_for_markdown(text: str) -> str:
|
| 52 |
+
import re
|
| 53 |
+
# Replace '\n' not preceded by '|' with '\n\n'
|
| 54 |
+
return re.sub(r'(?<!\|)\n', '\n\n', text)
|
| 55 |
|
| 56 |
def find_next_valid(docs_cache, reader_iter, start_idx: int, require_has_math: bool | None, require_has_infobox: bool | None, require_has_table: bool | None, require_has_code: bool | None):
|
| 57 |
# Scan cache first (forward from start_idx)
|