Added aria role and levels for stories and comments (#1149)

This commit is contained in:
Robert Melton 2023-02-08 11:47:40 -05:00 committed by GitHub
parent 29b0f1a243
commit 1d3ad81fc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -134,7 +134,7 @@ class="comment <%= comment.current_vote ? (comment.current_vote[:vote] == 1 ?
</span>
<% end %>
</div>
<div class="comment_text">
<div role="heading" aria-level="3" class="comment_text">
<% if comment.is_gone? %>
<p>
<span class="na">

View File

@ -24,7 +24,7 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
<div class="score"><%= story.show_score_to_user?(@user) ? story.score : '~' %></div>
</div>
<div class="details">
<span class="link h-cite u-repost-of">
<span role="heading" aria-level="1" class="link h-cite u-repost-of">
<% if story.can_be_seen_by_user?(@user) %>
<a class="u-url" href="<%= story.url_or_comments_path %>" rel="ugc <%= story.send_referrer? ? '' : 'noreferrer' %>"><%= story.title %></a>
<% end %>
@ -173,7 +173,7 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
<% if !story.is_gone? || @user.try(:is_moderator?) %>
<span class="comments_label">
<span> | </span>
<a href="<%= story.comments_path %>">
<a role="heading" aria-level="2" href="<%= story.comments_path %>">
<% if story.comments_count == 0 %>
no comments</a>
<% else %>