Skip to content
Snippets Groups Projects
Unverified Commit bf31b8b9 authored by Mike Coutermarsh's avatar Mike Coutermarsh
Browse files

Improve accessibility by adding label to Anchor links.

I ran Lighthouse on just-the-docs and noticed the anchor links
were missing a "discernible name".

This adds aria-labelledby to the header element to improve these for
screenreaders.
parent 50d72787
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,7 @@
{% capture anchor %}{% endcapture %}
{% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %}
{% capture anchor %}href="#{{ html_id}}"{% endcapture %}
{% capture anchor %}href="#{{ html_id}}" aria-labelledby="{{ html_id}}"{% endcapture %}
{% if include.anchorClass %}
{% capture anchor %}{{ anchor }} class="{{ include.anchorClass }}"{% endcapture %}
......@@ -97,4 +97,4 @@
{% endcapture %}
{% capture edited_headings %}{{ edited_headings }}{{ new_heading }}{% endcapture %}
{% endfor %}
{% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }}
\ No newline at end of file
{% endcapture %}{% assign headingsWorkspace = '' %}{{ edited_headings | strip }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment