Update docs/_utils/anchor-headings.js

Co-authored-by: Lea Verou <lea@verou.me>
This commit is contained in:
Cory LaViska
2024-12-03 12:06:31 -05:00
committed by GitHub
parent bda66ab4b9
commit d97bf9a9e9

View File

@@ -53,7 +53,7 @@ export function anchorHeadingsPlugin(options = {}) {
if (!id) {
const slug = createId(clone.textContent ?? '') ?? uuid().slice(-12);
id = slug;
let suffix = 0;
let suffix = 1;
// Make sure the slug is unique in the document
while (doc.getElementById(id) !== null) {