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:
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 totrue
) to control this. This could also work with the existinganchorLinkPosition
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: