-
Notifications
You must be signed in to change notification settings - Fork 922
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
[Bug report] The header anchor should stay outside of the heading tag #1363
Labels
Comments
This issue is marked as |
Yep, markdown-it-anchor has provided multiple solutions for that since v8.0. We didn't update to use other methods to get better a11y yet. Contribution welcome |
6 tasks
nruffing
added a commit
to nruffing/vuepress-next
that referenced
this issue
Dec 9, 2023
nruffing
added a commit
to nruffing/vuepress-next
that referenced
this issue
Dec 9, 2023
6 tasks
meteorlxy
added a commit
that referenced
this issue
Dec 12, 2023
#1452) BREAKING CHANGE: the default permalink function of markdown-it-anchor has been changed from `ariaHidden` to `headerLink` for better accessibility, which would be a potential breaking change for theme authors --------- Co-authored-by: Xinyu Liu <meteor.lxy@foxmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The header anchors
#
are placed inside the heading tags (h1, h2, h3...).This behaviour is not actually correct, since the heading tag should explicitly indicate the nature of the content as a title, and
#
shouldn't be part of it.Apart from the semantic issue, there is also a more problematic issue: crawlers, some social media crawlers may take the title from the h1 heading tag to create a post preview. This means that the preview title of the post will contain the "#" character.
This is an example of a VuePress post preview on LinkedIn
To reproduce I have a live link
https://www.mida.org/posts/reactive-programming-in-financial-markets/
The website above is built with VuePress 1 but the issue persists also on VuePress 2.
Thank you,
Vasile
Reproduction
https://www.mida.org/posts/reactive-programming-in-financial-markets/
Used Package Manager
npm
System Info
The text was updated successfully, but these errors were encountered: