Skip to content

A platform for community discussion. Free, open, simple.

A11Y: Category logos are decorative, set empty alt (#12830)

Krised373b2e7bf0
diff --git a/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs b/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs
index e22f84f4eaa..0c68d4efb18 100644
--- a/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/categories-boxes-with-topics.hbs
@@ -10,6 +10,7 @@
class="logo"
width=c.uploaded_logo.width
height=c.uploaded_logo.height
+ alt=""
}}
{{/if}}
{{/unless}}
diff --git a/app/assets/javascripts/discourse/app/templates/components/categories-boxes.hbs b/app/assets/javascripts/discourse/app/templates/components/categories-boxes.hbs
index cc73c8a375d..e4247e02590 100644
--- a/app/assets/javascripts/discourse/app/templates/components/categories-boxes.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/categories-boxes.hbs
@@ -9,6 +9,7 @@
class="logo"
width=c.uploaded_logo.width
height=c.uploaded_logo.height
+ alt=""
}}
{{/if}}
</div>
@@ -59,7 +60,8 @@
src=sc.uploaded_logo.url
class="logo"
width=sc.uploaded_logo.width
- height=sc.uploaded_logo.height}}
+ height=sc.uploaded_logo.height
+ alt=""}}
</span>
{{category-link sc hideParent="true"}}
</a>
diff --git a/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs b/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs
index 9de2a6a09b5..43cec199dc2 100644
--- a/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/category-title-link.hbs
@@ -11,6 +11,7 @@
src=category.uploaded_logo.url
class="category-logo"
width=category.uploaded_logo.width
- height=category.uploaded_logo.height}}
+ height=category.uploaded_logo.height
+ alt=""}}
{{/if}}
</a>
diff --git a/app/assets/javascripts/discourse/app/templates/components/cdn-img.hbs b/app/assets/javascripts/discourse/app/templates/components/cdn-img.hbs
index 9e58abd2bf2..3537d414e3d 100644
--- a/app/assets/javascripts/discourse/app/templates/components/cdn-img.hbs
+++ b/app/assets/javascripts/discourse/app/templates/components/cdn-img.hbs
@@ -1,5 +1,5 @@
{{#if src}}
<div class="{{class}} aspect-image" style={{style}}>
- <img src={{cdnSrc}} width={{width}} height={{height}}>
+ <img src={{cdnSrc}} width={{width}} height={{height}} alt={{alt}}>
</div>
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/templates/navigation/category.hbs b/app/assets/javascripts/discourse/app/templates/navigation/category.hbs
index 0b5a8fe0e88..94b8df91aae 100644
--- a/app/assets/javascripts/discourse/app/templates/navigation/category.hbs
+++ b/app/assets/javascripts/discourse/app/templates/navigation/category.hbs
@@ -7,6 +7,7 @@
class="category-logo"
width=category.uploaded_logo.width
height=category.uploaded_logo.height
+ alt=""
}}
{{#if category.description}}