Skip to content

Commit 26c91d5

Browse files
committed
GitHub: Make the title on single commit pages a heading.
Also fix the scope of a variable while I'm at it.
1 parent 61f7707 commit 26c91d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

GitHubA11yFixes.user.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ function makeHeading(elem, level) {
1616
}
1717

1818
function tweak(target) {
19+
var elem;
1920
var res = document.location.href.match(/github.com\/[^\/]+\/[^\/]+\/([^\/]+)(\/?)/);
2021
if (["issues", "pull"].indexOf(res[1]) >= 0 && res[2] == "/") {
2122
// Issue or pull request.
2223
// Comment headers.
2324
for (elem of target.querySelectorAll(".timeline-comment-header-text, .discussion-item-header"))
2425
makeHeading(elem, 3);
2526
} else if (res[1] == "commits" && res[2] == "/") {
26-
// Commits.
27+
// Commit listing.
2728
// Commit group headers.
2829
for (elem of target.querySelectorAll(".commit-group-title"))
2930
makeHeading(elem, 2);
31+
} else if (res[1] == "commit" && res[2] == "/") {
32+
// Single commit.
33+
if (elem = target.querySelector(".commit-title"))
34+
makeHeading(elem, 2);
3035
}
3136
}
3237

0 commit comments

Comments
 (0)