pre-commit

This commit is contained in:
Timmy Welch 2024-09-27 15:08:00 -07:00
parent 4cd70670cc
commit 78df903de7

View File

@ -49,7 +49,7 @@ def cleanup_html(string: str | None, remove_html_tables: bool = False) -> str:
string = re.sub(r"<br>|</li>", "\n", string, flags=re.IGNORECASE)
string = re.sub(r"<li>", "* ", string, flags=re.IGNORECASE)
string = re.sub(r"</p>", "\n\n", string, flags=re.IGNORECASE)
string = re.sub(r"<h([1-6])>", lambda m: '#'*int(m.group(1))+' ', string, flags=re.IGNORECASE)
string = re.sub(r"<h([1-6])>", lambda m: "#" * int(m.group(1)) + " ", string, flags=re.IGNORECASE)
string = re.sub(r"</h[1-6]>", "\n", string, flags=re.IGNORECASE)
# remove the tables