Skip to content

Conversation

mycarda
Copy link

@mycarda mycarda commented Jan 12, 2023

When the pass of the html is made for "add correct id to all headings" it duplicates the id used on the anchor tag and uses that in the heading tag. This results in a duplicate id which is invalid HTML (and specifically for my interest, fails accessibility standards WCAG 2.2 success criterium 4.1.1 - parsing). An example of the generated duplicate id in the header tag is

<h1 id="user-content-converting-markdown-to-html">
  <a
    aria-hidden="true"
    class="anchor"
    href="#user-content-converting-markdown-to-html"
    id="user-content-converting-markdown-to-html"
    name="user-content-converting-markdown-to-html">
    <span aria-hidden="true" class="octicon octicon-link"></span>
  </a>
  Converting markdown to HTML
</h1>

Bypassing "add correct id to all headings" results in

<h1>
  <a
    aria-hidden="true"
    class="anchor"
    href="#user-content-converting-markdown-to-html"
    id="user-content-converting-markdown-to-html"
    name="user-content-converting-markdown-to-html">
    <span aria-hidden="true" class="octicon octicon-link"></span>
  </a>
  Converting markdown to HTML
</h1>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant