Aevann 2023-02-24 01:38:00 +02:00
parent 3af5de76dc
commit 19482f4205
2 changed files with 3 additions and 3 deletions

View File

@ -48,8 +48,8 @@ strikethrough_regex = re.compile('(^|\s|>)~{1,2}([^~]+)~{1,2}(?![^<]*<\/(code|pr
mute_regex = re.compile("\/mute @?([a-z0-9_\-]{3,30}) ([0-9]+)", flags=re.A|re.I)
emoji_regex = re.compile(f"<p>\s*(:[!#@]{{0,3}}[{valid_username_chars}]+:\s*)+<\/p>", flags=re.A)
emoji_regex2 = re.compile(f'(?<!="):([!#@{valid_username_chars}]{{1,36}}?):(?![^<]*<\/(code|pre|a)>)', flags=re.A)
emoji_regex3 = re.compile(f'(?<!="):([!@{valid_username_chars}]{{1,35}}?):', flags=re.A)
emoji_regex2 = re.compile(f'(?<!"):([!#@{valid_username_chars}]{{1,36}}?):(?![^<]*<\/(code|pre|a)>)', flags=re.A)
emoji_regex3 = re.compile(f'(?<!"):([!@{valid_username_chars}]{{1,35}}?):', flags=re.A)
snappy_url_regex = re.compile('<a href="(https?:\/\/.+?)".*?>(.+?)<\/a>', flags=re.A)
snappy_youtube_regex = re.compile('<lite-youtube videoid="(.+?)" params="autoplay=1', flags=re.A)

View File

@ -265,7 +265,7 @@ def render_emoji(html, regexp, golden, marseys_used, b=False):
if emoji_html:
marseys_used.add(emoji)
html = re.sub(f'(?<!="){i.group(0)}(?![^<]*<\/(code|pre|a)>)', emoji_html, html)
html = re.sub(f'(?<!"){i.group(0)}(?![^<]*<\/(code|pre|a)>)', emoji_html, html)
return html