From a655d18fc20561b99a475a7b64cce59571344f95 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Fri, 16 Oct 2026 22:06:27 -1000 Subject: Mark avatar icons as decorative A screen reader announced the service's name before every author. --- custom/extensions/email-gravatar.lua | 7 +++---- custom/extensions/email-libravatar.lua | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'custom') diff --git a/custom/extensions/email-gravatar.lua b/custom/extensions/email-gravatar.lua index eca31ee..d5c30fc 100644 --- a/custom/extensions/email-gravatar.lua +++ b/custom/extensions/email-gravatar.lua @@ -42,7 +42,6 @@ local has_digest, digest = pcall(require, "openssl.digest") local avatar_size = 13 local default_image = "retro" local base_url = "https://www.gravatar.com/avatar/" -local alt_text = "Gravatar" -- One name reaches this filter as an open, writes and a close, so what the @@ -111,7 +110,8 @@ end -- A log page can carry one icon per commit, so the attributes let the -- browser defer the fetches for icons still off screen and keep decoding --- off the critical path. +-- off the critical path. The icon only decorates the name beside it, so its +-- alt text is empty and a screen reader goes straight to the name. function filter_close() if avatar_hash == nil then html(buffer) @@ -119,8 +119,7 @@ function filter_close() html("" .. alt_text ..
-			" " .. buffer) end diff --git a/custom/extensions/email-libravatar.lua b/custom/extensions/email-libravatar.lua index 3422dc1..719be2e 100644 --- a/custom/extensions/email-libravatar.lua +++ b/custom/extensions/email-libravatar.lua @@ -40,7 +40,6 @@ local has_digest, digest = pcall(require, "openssl.digest") local avatar_size = 13 local default_image = "retro" local base_url = "https://seccdn.libravatar.org/avatar/" -local alt_text = "Libravatar" -- One name reaches this filter as an open, writes and a close, so what the @@ -109,7 +108,8 @@ end -- A log page can carry one icon per commit, so the attributes let the -- browser defer the fetches for icons still off screen and keep decoding --- off the critical path. +-- off the critical path. The icon only decorates the name beside it, so its +-- alt text is empty and a screen reader goes straight to the name. function filter_close() if avatar_hash == nil then html(buffer) @@ -117,8 +117,7 @@ function filter_close() html("" .. alt_text ..
-			" " .. buffer) end -- cgit