You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No special configuration necessary. Header anchors are enabled by default.
This issue can be tested on the official VitePress site or any other basic vitepress deployment using the default-theme.
Expected behavior
Provide an accessible default configuration for markdown-it-anchor and update styling of header-anchors accordingly.
A possible solution could look like this:
<divclass="header-wrapper"><h1id="what-is-vitepress" tabindex="-1">What is VitePress?</h1><aclass="header-anchor" href="#what-is-vitepress" aria-label="Permalink to "WhatisVitePress?"">#</a></div>
A viable markdown-it-anchor configuration could look like this.
{anchor: {permalink: MdItAnchor.permalink.linkAfterHeader({style: "aria-label",assistiveText: (title)=>`Permalink to "${title}"`,visuallyHiddenClass: "visually-hidden",wrapper: ['<div class="header-wrapper">',"</div>"],}),},}
Additionally, some updates for anchor styling are necessary too.
Describe the bug
The header anchors are not accessible to screen reader users.
Setting
aria-hidden
on focusable elements (that are not hidden from all users) fails test "aria-hidden elements do not contain focusable elements".I'm preparing a PR to fix this issue.
Reproduction
No special configuration necessary. Header anchors are enabled by default.
This issue can be tested on the official VitePress site or any other basic vitepress deployment using the default-theme.
Expected behavior
Provide an accessible default configuration for
markdown-it-anchor
and update styling of header-anchors accordingly.A possible solution could look like this:
A viable
markdown-it-anchor
configuration could look like this.Additionally, some updates for anchor styling are necessary too.
System Info
Additional context
More details about test "aria-hidden elements do not contain focusable elements" can be found at https://dequeuniversity.com/rules/axe/4.4/aria-hidden-focus.
Validations
The text was updated successfully, but these errors were encountered: