mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 23:19:24 -05:00
Don't include html comments in description
This commit is contained in:
parent
32fc39fd4c
commit
5bcccfde6c
@ -345,7 +345,8 @@ class PreviewUrlResource(Resource):
|
|||||||
# lines)
|
# lines)
|
||||||
text_nodes = (
|
text_nodes = (
|
||||||
re.sub(r'\s+', '\n', el.text).strip()
|
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)
|
og['og:description'] = summarize_paragraphs(text_nodes)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user