mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -04:00
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:
parent
d3309b3338
commit
fda558d649
3 changed files with 7 additions and 7 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue