php-markdown icon indicating copy to clipboard operation
php-markdown copied to clipboard

Add support for making tags focusable for improved assistive technologies support

Open sunnywalker opened this issue 6 months ago • 0 comments

This article, local link targets must be focusable to prevent accessibility issues, suggests that focus is lost when local link anchors are not focusable, such as headings with ids. This pull request adds support for, by default, making headings with id attributes focusable via a tabindex="-1" attribute.

The implementation uses a class variable to allow overriding which tags are so enabled in a child class.

While this will change existing rendering, it will not break anything--headings with ids will continue to work as before, just with the added attribute.

sunnywalker avatar Jan 05 '24 23:01 sunnywalker