remotes/1693045480750635534/spooky-22
Aevann1 2021-09-30 23:34:44 +02:00
parent 95c20acbf5
commit f8d4563623
1 changed files with 0 additions and 5 deletions

View File

@ -149,18 +149,14 @@ def sanitize(sanitized, noimages=False):
]
).clean(sanitized)
#soupify
soup = BeautifulSoup(sanitized, features="html.parser")
#img elements - embed
for tag in soup.find_all("img"):
url = tag.get("src", "")
if not url: continue
if "profile-pic-20" not in tag.get("class", ""):
#print(tag.get('class'))
# set classes and wrap in link
tag["rel"] = "nofollow noopener noreferrer"
tag["style"] = "max-height: 100px; max-width: 100%;"
@ -219,7 +215,6 @@ def sanitize(sanitized, noimages=False):
for i in re.finditer("^(\s+)?((:[\w]+:)+(\s+)?)+", sanitized.replace("<p>", "").replace("</p>", ""), re.MULTILINE):
emojis = i.group(0).lower()
print(emojis)
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', emojis):
emoji = i.group(1).lower()
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):