Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a11y: Headings are read verbosely by VoiceOver #2980

Open
4 tasks done
qwerzl opened this issue Sep 17, 2023 · 0 comments · May be fixed by #4609
Open
4 tasks done

a11y: Headings are read verbosely by VoiceOver #2980

qwerzl opened this issue Sep 17, 2023 · 0 comments · May be fixed by #4609
Labels
a11y Related to accessibility stale

Comments

@qwerzl
Copy link

qwerzl commented Sep 17, 2023

Describe the bug

We should add an aria-label to the headings. Currently with aria-label not specified, VoiceOver returns heading level 1, 2 items What is VitePress, visited, link, Permalink to "What is VitePress?", which is very unclear and verbose.

Reproduction

Just head to https://vitepress.dev/guide/what-is-vitepress on Mac, open VoiceOver and click on any heading.

Expected behavior

An aria-label should be added to heading elements. Take the # What is VitePress? as an example, it should be rendered as:

<h1 id="what-is-vitepress" tabindex="-1" aria-label="What is VitePress?">
  <a class="header-anchor" href="#what-is-vitepress" aria-hidden="true">
    &ZeroWidthSpace;
  </a>
  What is VitePress? 
</h1>

Then VoiceOver returns Heading level 1, What is VitePress?.

System Info

System:
    OS: macOS 14.0
    CPU: (10) arm64 Apple M1 Pro
    Memory: 98.42 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 19.7.0 - ~/.nvm/versions/node/v19.7.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v19.7.0/bin/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v19.7.0/bin/npm
    pnpm: 8.6.0 - ~/.nvm/versions/node/v19.7.0/bin/pnpm
  Browsers:
    Chrome: 116.0.5845.187
    Safari: 17.0

Additional context

I am willing to fix this bug by myself. However as I'm not familiar with MarkdownIt, I think I need some help on where to customize the rendering rules of headers.

Validations

@qwerzl qwerzl added the bug: pending triage Maybe a bug, waiting for confirmation label Sep 17, 2023
@brc-dd brc-dd added a11y Related to accessibility and removed bug: pending triage Maybe a bug, waiting for confirmation labels Sep 17, 2023
qwerzl added a commit to qwerzl/vitepress that referenced this issue Sep 18, 2023
@github-actions github-actions bot added the stale label Oct 19, 2023
brc-dd added a commit that referenced this issue Mar 8, 2025
BREAKING CHANGES:
- `--vp-header-anchor-symbol` is removed
- The default permalink function of markdown-it-anchor is changed to `linkAfterHeader`. This will need updates in your custom themes.

This brings the original proposed behavior of #2039, #2040 which wasn't introduced to avoid breaking changes.

fixes #2980
closes #2982
@brc-dd brc-dd linked a pull request Mar 8, 2025 that will close this issue
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y Related to accessibility stale
Projects
None yet
2 participants