Merge pull request #2576 from maximevaillancourt/exclude-noscript-url-preview

Ignore <noscript> tags when generating URL preview descriptions
This commit is contained in:
Matthew Hodgson 2017-11-07 11:09:22 +00:00 committed by GitHub
commit 3db5ff69b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -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