toshimaru/jekyll-toc

`inject_anchors` generates empty links

anthonydillon opened this issue · 0 comments

The empty links generated by inject_anchors cause accessibility issues. Reference.

Currently the markup results in:

<h2 id="heading-one">
  <a class="anchor" href="#heading-one" aria-hidden="true">
    <span class="octicon octicon-link"></span>
  </a>
  Heading one
</h2>

I would suggest this would be better:

<h2 id="heading-one">
  <a class="anchor" href="#heading-one" aria-hidden="true">
    <span class="octicon octicon-link">Link to Header one section</span>
  </a>
  Heading one
</h2>

The content within the icon is hidden by default.