mirror of
https://github.com/element-hq/synapse.git
synced 2026-06-06 12:11:36 +00:00
Don't include html comments in description
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user