A11Y: Don't show title attr on post avatars (#10719)

A11Y: Don’t show title attr on post avatars (#10719)

diff --git a/app/assets/javascripts/discourse/app/widgets/post.js b/app/assets/javascripts/discourse/app/widgets/post.js
index 7b26b16..d93f410 100644
--- a/app/assets/javascripts/discourse/app/widgets/post.js
+++ b/app/assets/javascripts/discourse/app/widgets/post.js
@@ -35,7 +35,12 @@ export function avatarImg(wanted, attrs) {
   if (!url || url.length === 0) {
     return;
   }
-  const title = attrs.name || formatUsername(attrs.username);
+
+  let title;
+
+  if (!attrs.hideTitle) {
+    title = attrs.name || formatUsername(attrs.username);
+  }
 
   let className =
     "avatar" + (attrs.extraClasses ? " " + attrs.extraClasses : "");
@@ -168,6 +173,7 @@ createWidget("post-avatar", {
         name: attrs.name,
         url: attrs.usernameUrl,
         className: "main-avatar",
+        hideTitle: true,
       });
     }
 

GitHub sha: 614e0bab

This commit appears in #10719 which was approved by eviltrout. It was merged by awesomerobot.