Merge pull request #891 from perdedora/spoiler-883

Fix filename visible when image is spoiler
This commit is contained in:
Lorenzo Yario 2025-02-08 22:22:05 -06:00 committed by GitHub
commit 72292208ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,10 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if config.show_filename and file.filename %} {% if config.show_filename and file.filename %}
, {% if file.filename|length > config.max_filename_display %} ,
{% if file.thumb == 'spoiler' %}
<a href="{{ config.uri_img }}{{ file.file|e|bidi_cleanup }}" download="{{ file.filename|e|bidi_cleanup }}" title="{% trans %}Spoiler Image{% endtrans %}">{% trans %}Spoiler Image{% endtrans %}</a>
{% elseif file.filename|length > config.max_filename_display %}
<a href="{{ config.uri_img }}{{ file.file|e|bidi_cleanup }}" download="{{ file.filename|e|bidi_cleanup }}" title="Save as original filename: {{ file.filename|e|bidi_cleanup }}">{{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }}</a> <a href="{{ config.uri_img }}{{ file.file|e|bidi_cleanup }}" download="{{ file.filename|e|bidi_cleanup }}" title="Save as original filename: {{ file.filename|e|bidi_cleanup }}">{{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }}</a>
{% else %} {% else %}
<a href="{{ config.uri_img }}{{ file.file|e|bidi_cleanup }}" download="{{ file.filename|e|bidi_cleanup }}" title="Save as original filename">{{ file.filename|e|bidi_cleanup }}</a> <a href="{{ config.uri_img }}{{ file.file|e|bidi_cleanup }}" download="{{ file.filename|e|bidi_cleanup }}" title="Save as original filename">{{ file.filename|e|bidi_cleanup }}</a>