diff options
Diffstat (limited to 'utils.py')
| -rw-r--r-- | utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..aa0f4ed --- /dev/null +++ b/utils.py @@ -0,0 +1,9 @@ +import re +import html + +CLEANR = re.compile('<.*?>') + +def sanitize_html(raw_html): + cleantext = re.sub(CLEANR, '', raw_html) + return html.unescape(cleantext) + |
