summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorMaxime Vaillancourt <maxvaillancourt1@gmail.com>2017-10-25 20:44:34 -0400
committerMaxime Vaillancourt <maxvaillancourt1@gmail.com>2017-10-25 20:44:34 -0400
commit5287e57c86b180671c956802861fec9fcd843e39 (patch)
tree0e7ae74b5a6bc1fb3d69f175ec4e2a709cb4c221 /synapse/rest
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-5287e57c86b180671c956802861fec9fcd843e39.tar.xz
Ignore noscript tags when generating URL previews
Diffstat (limited to '')
-rw-r--r--synapse/rest/media/v1/preview_url_resource.py9
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