From 53d94529175dface366a935eea2c2bcc1eeab15c Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Mon, 21 Nov 2022 21:18:13 -0700 Subject: Outgoing mentions mostly work (exc. cc followers) --- core/html.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/html.py') 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)) -- cgit v1.2.3