Add alt tags to image attachments

This commit is contained in:
Wesley Moore 2024-11-24 17:13:36 +10:00
parent ef6ac8c042
commit b5a249b756
No known key found for this signature in database

View file

@ -259,7 +259,7 @@ markup::define! {
Attachment<'a>(attachment: &'a pleroma::activity::Attachment) { Attachment<'a>(attachment: &'a pleroma::activity::Attachment) {
@match attachment.media_type.as_str() { @match attachment.media_type.as_str() {
"image/gif" |"image/jpeg" | "image/png" => { "image/gif" |"image/jpeg" | "image/png" => {
img[src=&attachment.url, loading="lazy"]; img[src=&attachment.url, alt=&attachment.name, loading="lazy"];
} }
_ => { _ => {
a[href=&attachment.url] { @attachment.media_type " attachment" } a[href=&attachment.url] { @attachment.media_type " attachment" }