0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 09:33:53 +01:00

Don't include html comments in description

This commit is contained in:
Erik Johnston 2016-08-05 14:45:11 +01:00
parent 32fc39fd4c
commit 5bcccfde6c

View file

@ -345,7 +345,8 @@ class PreviewUrlResource(Resource):
# lines)
text_nodes = (
re.sub(r'\s+', '\n', el.text).strip()
for el in cloned_tree.iter() if el.text
for el in cloned_tree.iter()
if el.text and isinstance(el.tag, basestring) # Removes comments
)
og['og:description'] = summarize_paragraphs(text_nodes)