vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.17k stars 922 forks source link

feat(markdown): update default markdown-it-anchor permalink function (close #1363) #1452

Closed nruffing closed 6 months ago

nruffing commented 6 months ago

Before submitting the PR, please make sure you do the following

What is the purpose of this pull request?

Description

The heading anchors have aria-hidden attributes but are still focusable via keyboard navigation. There was a bit of discussion around this already in the markdown-it-anchor repo and you can address this by just using the headerLink render function instead of the ariaHidden render function since it wraps the entire header in an anchor.

This fixes #1363

Screenshots

We will also need to make some changes to theme-default's base styles to accompany these changes. I will put that PR up shortly and include screenshots there.

Before

After

meteorlxy commented 6 months ago

cc @Mister-Hope any thoughts about this? It should be kind of breaking change for community themes.

Mister-Hope commented 6 months ago

I actually do not care about these kind of changes, my theme is designed to be aligning an exact version of VuePress so it won't bother me.

This fix the a11y issue, so I am positive towards it.