We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c5ec7c commit 17d39ddCopy full SHA for 17d39dd
src/render_html.js
@@ -54,7 +54,10 @@ function maybeSplitInlineCode(html) {
54
const seenIDs = Object.create(null)
55
function anchor(token) {
56
let id = token.hashID
57
- if (!id || id in seenIDs) return ""
+ if (id in seenIDs) for (let i = 1;; i++) {
58
+ let ext = id + "_" + i
59
+ if (!(ext in seenIDs)) { id = ext; break }
60
+ }
61
seenIDs[id] = true
62
return `<a class="${id.charAt(0)}_ident" id="${id}" href="#${id}" tabindex="-1" role="presentation"></a>`
63
}
0 commit comments