markdown-it-toc-done-right icon indicating copy to clipboard operation
markdown-it-toc-done-right copied to clipboard

Add an optional aria-label to the nav element for screen readers

Open MarcoZehe opened this issue 3 years ago • 2 comments

When including a TOC on a page, it can happen that this is not the only nav container on a page, with the main navigation possibly being at least one other. it would be good if the plugin would include a default name for the nav element, set via aria-label, and add an option to override this. So the nav would be:

nav aria-label="Table of contents" ...
...
</nav>

or the user provided alternative if they set it.

I am using Markdown-It-TOC-Done-Right in a new Eleventy project and found it the best TOC solution, with only this little bit missing.

Thank you for considering accessibility as one of the reasons why Markdown-It-TOC-Done-Right is the better choice over others! ❤️

MarcoZehe avatar Jan 16 '21 18:01 MarcoZehe