fix: Photos without alt text use the post's text (v2.6.5)
Uncaptioned photos rendered alt="Image", which mf2 parsers report as the photo's alt text. They now take the post's text (excerpt, up to 150 characters), falling back to "Image" only for text-free posts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a551770c76
commit
4ffe36f9d3
6 files changed
+27
-6
No files matched your search
@@ -1,11 +1,12 @@
|
||||
{# Reusable media display macro #}
|
||||
{% macro display_media(media_items) %}
|
||||
{# fallback_alt: for photos without a caption, usually the post's text (v2.6.5) #}
|
||||
{% macro display_media(media_items, fallback_alt='') %}
|
||||
{% if media_items %}
|
||||
<div class="note-media">
|
||||
{% for item in media_items %}
|
||||
<figure class="media-item">
|
||||
<img src="{{ url_for('public.media_file', path=item.path) }}"
|
||||
alt="{{ item.caption or 'Image' }}"
|
||||
alt="{{ item.caption or fallback_alt or 'Image' }}"
|
||||
class="u-photo"
|
||||
loading="lazy">
|
||||
{# No figcaption - caption is for alt text only #}
|
||||
|
||||
Reference in new issue
Block a user