master
Aevann1 2021-10-06 02:28:22 +02:00
parent 0c1ab3b390
commit 5a2bb1a497
3 changed files with 4 additions and 4 deletions

View File

@ -196,7 +196,7 @@ def sanitize(sanitized, noimages=False):
if emoji.startswith("!"):
emoji = emoji[1:]
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
new = re.sub(f'\w*(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=60 src="" data-src="https://{site}/assets/images/emojis/{emoji}.webp" style="transform: scaleX(-1)">', new)
new = re.sub(f'\w*(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=60 src="" data-src="https://{site}/assets/images/emojis/{emoji}.webp" style="transform: scaleX(-1);-webkit-transform: scaleX(-1);">', new)
elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
new = re.sub(f'\w*(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=60 src="" data-src="https://{site}/assets/images/emojis/{emoji}.webp">', new)
@ -212,7 +212,7 @@ def sanitize(sanitized, noimages=False):
if emoji.startswith("!"):
emoji = emoji[1:]
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
sanitized = re.sub(f'\w*(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=30 src="" data-src="https://{site}/assets/images/emojis/{emoji}.webp" style="transform: scaleX(-1)">', sanitized)
sanitized = re.sub(f'\w*(?<!"):!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=30 src="" data-src="https://{site}/assets/images/emojis/{emoji}.webp" style="transform: scaleX(-1);-webkit-transform: scaleX(-1);">', sanitized)
elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
sanitized = re.sub(f'\w*(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=30 src="" data-src="https://{site}/assets/images/emojis/{emoji}.webp">', sanitized)

View File

@ -384,7 +384,7 @@ def filter_title(title):
if emoji.startswith("!"):
emoji = emoji[1:]
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
title = title.replace(f':!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=20 src="https://{site}/assets/images/emojis/{emoji}.webp" style="transform: scaleX(-1)">')
title = title.replace(f':!{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":!{emoji}:" title=":!{emoji}:" delay="0" height=20 src="https://{site}/assets/images/emojis/{emoji}.webp" style="transform: scaleX(-1);-webkit-transform: scaleX(-1);">')
elif path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
title = title.replace(f':{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=20 src="https://{site}/assets/images/emojis/{emoji}.webp">')

View File

@ -60,7 +60,7 @@ On {{'SITE_NAME' | app_config}}, you can use Markdown formatting.
<tr>
<td>Mirrored Emojis</td>
<td>:!marseylove:</td>
<td><img loading="lazy" data-bs-toggle="tooltip" style="transform: scaleX(-1)" alt=":!marseylove:" title=":!marseylove:" delay="0" height="20" src="/assets/images/emojis/marseylove.webp"></td>
<td><img loading="lazy" data-bs-toggle="tooltip" style="transform: scaleX(-1);-webkit-transform: scaleX(-1);" alt=":!marseylove:" title=":!marseylove:" delay="0" height="20" src="/assets/images/emojis/marseylove.webp"></td>
</tr>
<tr>
<td>Poll Options</td>