diff options
author | Matthew Hodgson <matthew@arasphere.net> | 2017-11-07 11:09:22 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-07 11:09:22 +0000 |
commit | 3db5ff69b26963b695d0ce927a3138e04f53906a (patch) | |
tree | 78dc946efb5eb6ac95d3f7ce2c3d0cb43297ccda /synapse/rest | |
parent | Merge pull request #2646 from matrix-org/rav/logging_for_limiter (diff) | |
parent | Ignore noscript tags when generating URL previews (diff) | |
download | synapse-3db5ff69b26963b695d0ce927a3138e04f53906a.tar.xz |
Merge pull request #2576 from maximevaillancourt/exclude-noscript-url-preview
Ignore <noscript> tags when generating URL preview descriptions
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/media/v1/preview_url_resource.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/rest/media/v1/preview_url_resource.py b/synapse/rest/media/v1/preview_url_resource.py index 80114fca0d..7907a9d17a 100644 --- a/synapse/rest/media/v1/preview_url_resource.py +++ b/synapse/rest/media/v1/preview_url_resource.py @@ -520,7 +520,14 @@ def _calc_og(tree, media_uri): from lxml import etree TAGS_TO_REMOVE = ( - "header", "nav", "aside", "footer", "script", "style", etree.Comment + "header", + "nav", + "aside", + "footer", + "script", + "noscript", + "style", + etree.Comment ) # Split all the text nodes into paragraphs (by splitting on new |