Skip to content
Snippets Groups Projects
Unverified Commit 317248d4 authored by reivilibre's avatar reivilibre Committed by GitHub
Browse files

Improve URL previews by not including the content of media tags in the...

Improve URL previews by not including the content of media tags in the generated description. (#12887)
parent 9385cd06
No related branches found
No related tags found
No related merge requests found
Improve URL previews by not including the content of media tags in the generated description.
\ No newline at end of file
......@@ -246,7 +246,9 @@ def parse_html_description(tree: "etree.Element") -> Optional[str]:
Grabs any text nodes which are inside the <body/> tag, unless they are within
an HTML5 semantic markup tag (<header/>, <nav/>, <aside/>, <footer/>), or
if they are within a <script/> or <style/> tag.
if they are within a <script/>, <svg/> or <style/> tag, or if they are within
a tag whose content is usually only shown to old browsers
(<iframe/>, <video/>, <canvas/>, <picture/>).
This is a very very very coarse approximation to a plain text render of the page.
......@@ -268,6 +270,12 @@ def parse_html_description(tree: "etree.Element") -> Optional[str]:
"script",
"noscript",
"style",
"svg",
"iframe",
"video",
"canvas",
"img",
"picture",
etree.Comment,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment