mirror of
				https://git.sr.ht/~tsileo/microblog.pub
				synced 2025-06-05 21:59:23 +02:00 
			
		
		
		
	Tweak the privacy replace feature
This commit is contained in:
		| @@ -12,7 +12,6 @@ from app.actor import LOCAL_ACTOR | |||||||
| from app.actor import Actor | from app.actor import Actor | ||||||
| from app.actor import RemoteActor | from app.actor import RemoteActor | ||||||
| from app.media import proxied_media_url | from app.media import proxied_media_url | ||||||
| from app.utils import privacy_replace |  | ||||||
| from app.utils.datetime import now | from app.utils.datetime import now | ||||||
| from app.utils.datetime import parse_isoformat | from app.utils.datetime import parse_isoformat | ||||||
|  |  | ||||||
| @@ -178,7 +177,7 @@ class Object: | |||||||
|         if self.ap_object.get("mediaType") == "text/markdown": |         if self.ap_object.get("mediaType") == "text/markdown": | ||||||
|             content = markdown(content, extensions=["mdx_linkify"]) |             content = markdown(content, extensions=["mdx_linkify"]) | ||||||
|  |  | ||||||
|         return privacy_replace.replace_content(content) |         return content | ||||||
|  |  | ||||||
|     @property |     @property | ||||||
|     def summary(self) -> str | None: |     def summary(self) -> str | None: | ||||||
|   | |||||||
| @@ -307,7 +307,9 @@ def _clean_html(html: str, note: Object) -> str: | |||||||
|         return _emojify( |         return _emojify( | ||||||
|             _replace_custom_emojis( |             _replace_custom_emojis( | ||||||
|                 bleach.clean( |                 bleach.clean( | ||||||
|                     _update_inline_imgs(highlight(html)), |                     privacy_replace.replace_content( | ||||||
|  |                         _update_inline_imgs(highlight(html)) | ||||||
|  |                     ), | ||||||
|                     tags=ALLOWED_TAGS, |                     tags=ALLOWED_TAGS, | ||||||
|                     attributes=ALLOWED_ATTRIBUTES, |                     attributes=ALLOWED_ATTRIBUTES, | ||||||
|                     strip=True, |                     strip=True, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user