valeriangalliat / markdown-it-anchor

A markdown-it plugin that adds an `id` attribute to headings and optionally permalinks.
The Unlicense
291 stars 72 forks source link

Suggestion: add `tabindex` to targets #85

Closed thierryk closed 3 years ago

thierryk commented 3 years ago

Adding tabindex="-1" to the target of the anchors will allow default UA styling (i.e. outline). It can also be used in lieu of :target for styling, but more importantly it should make the UA focus on the target when the anchors are activated or when the page loads with that hash (there is a default styling for :focus but there is none for :target).