Skip to content

Commit 6c35454

Browse files
Menelionlunnyjolheiser
authored
Improve accessibility for issue comments (#22612)
Currently in Gitea issue comments are not marked up with headings. I'm trying to fix this by adding an appropriate [ARIA](https://www.w3.org/WAI/standards-guidelines/aria/) role for comment header and also by enclosing the comment itself in a semantical article element. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
1 parent a084e18 commit 6c35454

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

templates/repo/issue/view_content.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</a>
2828
{{end}}
2929
<div class="content comment-container">
30-
<div class="ui top attached header comment-header gt-df gt-ac gt-sb">
30+
<div class="ui top attached header comment-header gt-df gt-ac gt-sb" role="heading" aria-level="3">
3131
<div class="comment-header-left gt-df gt-ac">
3232
{{if .Issue.OriginalAuthor}}
3333
<span class="text black gt-bold">
@@ -69,7 +69,7 @@
6969
{{end}}
7070
</div>
7171
</div>
72-
<div class="ui attached segment comment-body">
72+
<div class="ui attached segment comment-body" role="article">
7373
<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission $.IsIssuePoster}}data-can-edit="true"{{end}}>
7474
{{if .Issue.RenderedContent}}
7575
{{.Issue.RenderedContent|Str2html}}
@@ -85,7 +85,7 @@
8585
</div>
8686
{{$reactions := .Issue.Reactions.GroupByType}}
8787
{{if $reactions}}
88-
<div class="ui attached segment reactions">
88+
<div class="ui attached segment reactions" role="note">
8989
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}}
9090
</div>
9191
{{end}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</a>
2323
{{end}}
2424
<div class="content comment-container">
25-
<div class="ui top attached header comment-header gt-df gt-ac gt-sb">
25+
<div class="ui top attached header comment-header gt-df gt-ac gt-sb" role="heading" aria-level="3">
2626
<div class="comment-header-left gt-df gt-ac">
2727
{{if .OriginalAuthor}}
2828
<span class="text black gt-bold gt-mr-2">
@@ -69,7 +69,7 @@
6969
{{end}}
7070
</div>
7171
</div>
72-
<div class="ui attached segment comment-body">
72+
<div class="ui attached segment comment-body" role="article">
7373
<div class="render-content markup" {{if or $.Permission.IsAdmin $.HasIssuesOrPullsWritePermission (and $.IsSigned (eq $.SignedUserID .PosterID))}}data-can-edit="true"{{end}}>
7474
{{if .RenderedContent}}
7575
{{.RenderedContent|Str2html}}
@@ -85,7 +85,7 @@
8585
</div>
8686
{{$reactions := .Reactions.GroupByType}}
8787
{{if $reactions}}
88-
<div class="ui attached segment reactions">
88+
<div class="ui attached segment reactions" role="note">
8989
{{template "repo/issue/view_content/reactions" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}}
9090
</div>
9191
{{end}}

0 commit comments

Comments
 (0)