aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-04 12:51:24 +0000
committerGravatar jesopo2019-11-04 12:51:24 +0000
commit516884acb848e692d2442a4ce083c5ff83b5296d (patch)
tree994b1061489fbdeec91f1c1be0c8e0f1905c9b48 /modules
parentbetter line normalisation for fediverse Activities (diff)
signature
only .decompose() when it's an empty and unknown tag
Diffstat (limited to 'modules')
-rw-r--r--modules/fediverse/ap_utils.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/fediverse/ap_utils.py b/modules/fediverse/ap_utils.py
index 5993e2b2..d21985df 100644
--- a/modules/fediverse/ap_utils.py
+++ b/modules/fediverse/ap_utils.py
@@ -77,9 +77,10 @@ def _normalise_note(content):
lines = []
for element in soup.find_all():
if not element.name in KNOWN_TAGS:
- element.unwrap()
- elif element.text.strip() == "":
- element.decompose()
+ if element.text.strip() == "":
+ element.decompose()
+ else:
+ element.unwrap()
out = ""
for element in soup.children: