diff options
Diffstat (limited to 'custom')
-rw-r--r--custom/extensions/email-gravatar.lua7
-rw-r--r--custom/extensions/email-libravatar.lua7
2 files changed, 6 insertions, 8 deletions
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("<img src='" .. base_url .. avatar_hash ..
"?s=" .. avatar_size ..
"&amp;d=" .. default_image ..
- "' alt='" .. alt_text ..
- "' width='" .. avatar_size ..
+ "' alt='' width='" .. avatar_size ..
"' height='" .. avatar_size ..
"' loading='lazy' decoding='async'> " .. 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("<img src='" .. base_url .. avatar_hash ..
"?s=" .. avatar_size ..
"&amp;d=" .. default_image ..
- "' alt='" .. alt_text ..
- "' width='" .. avatar_size ..
+ "' alt='' width='" .. avatar_size ..
"' height='" .. avatar_size ..
"' loading='lazy' decoding='async'> " .. buffer)
end