This fixes a collision with the ID generation where it a previous entry could generate a unique ID like "foo-1", but then a header with the text "Foo 1" would collide with it. This fixes it so that when generating the ID for "Foo 1", it will loop unit it finds an ID that doesn't collide (in this case, `foo-1-1`).
10 lines
No EOL
1,020 B
HTML
10 lines
No EOL
1,020 B
HTML
<h1 id="header-links"><a class="header" href="#header-links">Header Links</a></h1>
|
|
<h2 id="foobar"><a class="header" href="#foobar">Foo^bar</a></h2>
|
|
<h3 id=""><a class="header" href="#"></a></h3>
|
|
<h4 id="-1"><a class="header" href="#-1"></a></h4>
|
|
<h2 id="hï"><a class="header" href="#hï">Hï</a></h2>
|
|
<h2 id="repeat"><a class="header" href="#repeat">Repeat</a></h2>
|
|
<h2 id="repeat-1"><a class="header" href="#repeat-1">Repeat</a></h2>
|
|
<h2 id="repeat-2"><a class="header" href="#repeat-2">Repeat</a></h2>
|
|
<h2 id="repeat-1-1"><a class="header" href="#repeat-1-1">Repeat 1</a></h2>
|
|
<h2 id="with-emphasis-bold-bold_emphasis-code-escaped-html-link-httpsexamplecom"><a class="header" href="#with-emphasis-bold-bold_emphasis-code-escaped-html-link-httpsexamplecom"><!--comment--> With <em>emphasis</em> <strong>bold</strong> <strong><em>bold_emphasis</em></strong> <code>code</code> <escaped> <span>html</span> <a href="https://example.com/link">link</a> <a href="https://example.com/">https://example.com/</a></a></h2> |