Replace image rendered in the HTML to thumbnail if possible

This commit is contained in:
KnugiHK
2023-06-15 16:19:35 +08:00
parent 3443143744
commit a49a911e03
3 changed files with 22 additions and 4 deletions

View File

@@ -128,7 +128,7 @@
{{ msg.data | sanitize_except() }}
{% else %}
{% if "image/" in msg.mime %}
<a href="{{ msg.data }}"><img src="{{ msg.data }}" /></a>
<a href="{{ msg.data }}"><img src="{{ msg.thumb if msg.thumb is not none else msg.data }}" /></a>
{% elif "audio/" in msg.mime %}
<audio controls="controls" autobuffer="autobuffer">
<source src="{{ msg.data }}" />
@@ -206,7 +206,7 @@
{{ msg.data | sanitize_except() }}
{% else %}
{% if "image/" in msg.mime %}
<a href="{{ msg.data }}"><img src="{{ msg.data }}" /></a>
<a href="{{ msg.data }}"><img src="{{ msg.thumb if msg.thumb is not none else msg.data }}" /></a>
{% elif "audio/" in msg.mime %}
<audio controls preload="auto">
<source src="{{ msg.data }}" />