cxvcvx
This commit is contained in:
parent
3d3aad7414
commit
2db66c6149
4 changed files with 24 additions and 27 deletions
|
@ -110,7 +110,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
if u:
|
||||
sanitized = sanitized.replace(i.group(0), f'''<p><a href="/id/{u.id}"><img alt="@{u.username}'s profile picture" loading="lazy" src="/uid/{u.id}/pic" class="pp20">@{u.username}</a>''', 1)
|
||||
else:
|
||||
sanitized = re.sub('(^|\s|\n|<p>)\/?((r|u)\/\w{3,25})', r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized)
|
||||
sanitized = re.sub('(^|\s|\n|<p>)\/?((r|u)\/(\w|-){3,25})', r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized)
|
||||
|
||||
for i in re.finditer('(^|\s|\n|<p>)@((\w|-){1,25})', sanitized):
|
||||
u = get_user(i.group(2), graceful=True)
|
||||
|
@ -268,7 +268,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
|
||||
def filter_emojis_only(title):
|
||||
|
||||
title = title.replace('<','').replace('>','').replace("\n", "").replace("\r", "").replace("\t", "").strip()
|
||||
title = title.replace('<','').replace("\n", "").replace("\r", "").replace("\t", "").strip()
|
||||
|
||||
title = bleach.clean(title, tags=[])
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue