Update dependency markdown-it-anchor to v6 (#642)

* Update dependency markdown-it-anchor to v6
* Set initial slug-count offset on duplicate headings to 1 instead of 2

Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Erik Michelson <github@erik.michelson.eu>

Co-authored-by: Erik Michelson <github@erik.michelson.eu>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot] 2020-11-26 22:05:17 +01:00 committed by GitHub
parent d3309b3338
commit fda558d649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -26,8 +26,8 @@ const convertLevel = (toc: TocAst, levelsToShowUnderThis: number, headerCounts:
}
const rawName = toc.n.trim()
const nameCount = (headerCounts.get(rawName) ?? 0) + 1
const slug = `#${slugify(rawName)}${nameCount > 1 ? `-${nameCount}` : ''}`
const nameCount = (headerCounts.get(rawName) ?? -1) + 1
const slug = `#${slugify(rawName)}${nameCount > 0 ? `-${nameCount}` : ''}`
headerCounts.set(rawName, nameCount)