open-law/app/controllers/clean_html.py
Kostiantyn Stoliarskyi d8d0db943d working on
2023-05-23 15:52:49 +03:00

10 lines
193 B
Python

import re
# as per recommendation from @freylis, compile once only
CLEANR = re.compile("<.*?>")
def clean_html(raw_html):
clean_text = re.sub(CLEANR, "", raw_html)
return clean_text