diff options
author | Matthew Hodgson <matthew@matrix.org> | 2017-05-22 21:14:20 +0100 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2017-05-22 21:14:20 +0100 |
commit | 836d5c44b6457a93c0d163e721ded153382d2a79 (patch) | |
tree | dc4bcd5a03d40dc2c3dcbf5f7a675b4d229062f1 /synapse/rest | |
parent | Merge pull request #2231 from aaronraimist/patch-1 (diff) | |
download | synapse-836d5c44b6457a93c0d163e721ded153382d2a79.tar.xz |
actually trim oversize og:description meta
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/media/v1/preview_url_resource.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py index 99760d622f..c680fddab5 100644 --- a/synapse/rest/media/v1/preview_url_resource.py +++ b/synapse/rest/media/v1/preview_url_resource.py @@ -434,6 +434,8 @@ def _calc_og(tree, media_uri): for el in _iterate_over_text(tree.find("body"), *TAGS_TO_REMOVE) ) og['og:description'] = summarize_paragraphs(text_nodes) + else: + og['og:description'] = summarize_paragraphs([og['og:description']]) # TODO: delete the url downloads to stop diskfilling, # as we only ever cared about its OG |