Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Enhancement: option to place the anchor link outside the heading element #36

Closed
JezDriver opened this issue Feb 1, 2024 · 0 comments
Closed
Labels

Comments

@JezDriver
Copy link

As explained in this article, having the anchor link within the heading element can cause accessibility issues, as the text content of the heading becomes something like "Heading example Direct link to heading example".

It would be great to have a config option like anchorLinkInHeading (boolean, defaults to true) to control this.
This could also work with the existing anchorLinkPosition option, to render it before or after the heading element.

For reference, this is the recommended markup from Amber (author of the article) for best accessibility:

<h2 id="introduction">Introduction</h2>
<a href="#introduction">
  <span aria-hidden="true">#</span>
  <span class="hidden">Section titled introduction</span>
</a>
@JezDriver JezDriver added the bug label Feb 1, 2024
@craftcms craftcms locked and limited conversation to collaborators Mar 15, 2024
@brandonkelly brandonkelly converted this issue into discussion #38 Mar 15, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant