summaryrefslogtreecommitdiffstats
path: root/core/html.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/html.py')
-rw-r--r--core/html.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/html.py b/core/html.py
index 5045b16..3230284 100644
--- a/core/html.py
+++ b/core/html.py
@@ -30,3 +30,11 @@ def sanitize_post(post_html: str) -> str:
strip=True,
)
return mark_safe(cleaner.clean(post_html))
+
+
+def strip_html(post_html: str) -> str:
+ """
+ Strips all tags from the text, then linkifies it.
+ """
+ cleaner = bleach.Cleaner(tags=[], strip=True, filters=[LinkifyFilter])
+ return mark_safe(cleaner.clean(post_html))