Clean strings in comments before displaying

This commit is contained in:
Ozzie Isaacs
2026-04-03 09:01:01 +02:00
parent 00686ec1f2
commit 7c715f34dc
5 changed files with 11 additions and 4 deletions

View File

@@ -35,7 +35,7 @@ def clean_string(unsafe_text, book_id=0):
try:
if bleach:
allowed_tags = list(ALLOWED_TAGS)
allowed_tags.extend(["p", "span", "div", "pre", "br", "h1", "h2", "h3", "h4", "h5", "h6"])
allowed_tags.extend(["p", "span", "div", "pre", "br", "h1", "h2", "h3", "h4", "h5", "h6", "img"])
safe_text = clean_html(unsafe_text, tags=set(allowed_tags))
else:
safe_text = clean_html(unsafe_text)