Skip to content

Commit

Permalink
Use h2 in search results for accessibility
Browse files Browse the repository at this point in the history
axe DevTools highlighted an issue with heading levels being skipped - this
changes the search results to use `h2` instead of `h3` to fix this issue
  • Loading branch information
yndajas committed Nov 18, 2022
1 parent 6262626 commit dd7d160
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/assets/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
innerHtml +=
'<li class="search-results__result">' +
`<a href="${item.url}">` +
`<h3 class="search-results__result-title">${item.title}</h3>` +
`<h2 class="search-results__result-title">${item.title}</h2>` +
'</a>' +
(breadcrumbs.length ? `<div class='search-results__result-breadcrumbs'>${breadcrumbsString}</div>` : '') +
`<p class="search-results__result-excerpt">${excerpt}</p>` +
Expand Down

0 comments on commit dd7d160

Please sign in to comment.