dffd
This commit is contained in:
parent
1143ac95b5
commit
b26ba1a543
1 changed files with 1 additions and 7 deletions
|
@ -123,6 +123,7 @@ def sanitize(text, linkgen=False, flair=False):
|
|||
netloc = urlparse(url).netloc
|
||||
|
||||
domain = get_domain(netloc)
|
||||
|
||||
if "profile-pic-20" not in tag.get("class", ""):
|
||||
#print(tag.get('class'))
|
||||
# set classes and wrap in link
|
||||
|
@ -141,13 +142,6 @@ def sanitize(text, linkgen=False, flair=False):
|
|||
link["data-target"] = "#expandImageModal"
|
||||
|
||||
tag.wrap(link)
|
||||
else:
|
||||
# non-whitelisted images get replaced with links
|
||||
new_tag = soup.new_tag("a")
|
||||
new_tag.string = tag["src"]
|
||||
new_tag["href"] = tag["src"]
|
||||
new_tag["rel"] = "nofollow noopener"
|
||||
tag.replace_with(new_tag)
|
||||
|
||||
#disguised link preventer
|
||||
for tag in soup.find_all("a"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue