summaryrefslogtreecommitdiffstats
path: root/core/html.py
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-17 19:31:00 -0700
committerAndrew Godwin2022-11-17 17:55:50 -0700
commit2a3690d1c148da5dd799052403ba7290e1fb7de0 (patch)
tree6a1c92cdbea7ee2e307a99dd114610c83b33f82a /core/html.py
parent291d7e404e12e1d017403242f8ed199046f0904c (diff)
downloadtakahe-2a3690d1c148da5dd799052403ba7290e1fb7de0.tar.gz
takahe-2a3690d1c148da5dd799052403ba7290e1fb7de0.tar.bz2
takahe-2a3690d1c148da5dd799052403ba7290e1fb7de0.zip
Return images and summary in actor
Diffstat (limited to 'core/html.py')
-rw-r--r--core/html.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/html.py b/core/html.py
index fd41a50..5045b16 100644
--- a/core/html.py
+++ b/core/html.py
@@ -20,12 +20,13 @@ def sanitize_post(post_html: str) -> str:
Only allows a, br, p and span tags, and class attributes.
"""
cleaner = bleach.Cleaner(
- tags=["a", "br", "p", "span"],
+ tags=["br", "p"],
attributes={ # type:ignore
"a": allow_a,
"p": ["class"],
"span": ["class"],
},
filters=[LinkifyFilter],
+ strip=True,
)
return mark_safe(cleaner.clean(post_html))