From ff59e49866b0345736afb0c68128e7391ed7668a Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Tue, 9 Aug 2022 23:09:37 +0200 Subject: [PATCH] Tweak the privacy replace feature --- app/ap_object.py | 3 +-- app/templates.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/ap_object.py b/app/ap_object.py index f96b5c6..9f18b8b 100644 --- a/app/ap_object.py +++ b/app/ap_object.py @@ -12,7 +12,6 @@ from app.actor import LOCAL_ACTOR from app.actor import Actor from app.actor import RemoteActor from app.media import proxied_media_url -from app.utils import privacy_replace from app.utils.datetime import now from app.utils.datetime import parse_isoformat @@ -178,7 +177,7 @@ class Object: if self.ap_object.get("mediaType") == "text/markdown": content = markdown(content, extensions=["mdx_linkify"]) - return privacy_replace.replace_content(content) + return content @property def summary(self) -> str | None: diff --git a/app/templates.py b/app/templates.py index c5c501d..de3c5d1 100644 --- a/app/templates.py +++ b/app/templates.py @@ -307,7 +307,9 @@ def _clean_html(html: str, note: Object) -> str: return _emojify( _replace_custom_emojis( bleach.clean( - _update_inline_imgs(highlight(html)), + privacy_replace.replace_content( + _update_inline_imgs(highlight(html)) + ), tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES, strip=True,