Skip to content

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

A11Y: Add `aria-label` to topic post badges (#18657)

Keegan Georgedcbfbbf19d36
diff --git a/app/assets/javascripts/discourse/app/templates/topic-post-badges.hbr b/app/assets/javascripts/discourse/app/templates/topic-post-badges.hbr
index 5c1ec0cd2bf..81017949a6c 100644
--- a/app/assets/javascripts/discourse/app/templates/topic-post-badges.hbr
+++ b/app/assets/javascripts/discourse/app/templates/topic-post-badges.hbr
@@ -1,11 +1,26 @@
-<span class='topic-post-badges'>
- {{~#if newPosts ~}}
- &nbsp;<a href='{{url}}' class='badge badge-notification unread-posts' title='{{i18n "topic.unread_posts" count=newPosts}}'>{{newPosts}}</a>
+<span class="topic-post-badges">
+ {{~#if newPosts~}}
+ &nbsp;<a
+ href="{{url}}"
+ class="badge badge-notification unread-posts"
+ title="{{i18n 'topic.unread_posts' count=newPosts}}"
+ aria-label="{{i18n 'topic.unread_posts' count=newPosts}}"
+ >{{newPosts}}</a>
{{~/if}}
- {{~#if unreadPosts ~}}
- &nbsp;<a href='{{url}}' class='badge badge-notification unread-posts' title='{{i18n "topic.unread_posts" count=unreadPosts}}'>{{unreadPosts}}</a>
+ {{~#if unreadPosts~}}
+ &nbsp;<a
+ href="{{url}}"
+ class="badge badge-notification unread-posts"
+ title="{{i18n 'topic.unread_posts' count=unreadPosts}}"
+ aria-label="{{i18n 'topic.unread_posts' count=unreadPosts}}"
+ >{{unreadPosts}}</a>
{{~/if}}
- {{~#if unseen ~}}
- &nbsp;<a href='{{url}}' class='badge badge-notification new-topic' title='{{i18n "topic.new"}}'>{{newDotText}}</a>
+ {{~#if unseen~}}
+ &nbsp;<a
+ href="{{url}}"
+ class="badge badge-notification new-topic"
+ title="{{i18n 'topic.new'}}"
+ aria-label="{{i18n 'topic.new'}}"
+ >{{newDotText}}</a>
{{~/if}}
</span>