Closed bkrnetic closed 2 years ago
Hey!
Sadly I'm not aware of a unified standard about anchors in markdown, it seems that every website/tool have somewhat different rules for "slugification" (e.g. converting "Beautiful header" into beautiful-header
) and deduplication, for example GitHub would do beautiful-header
then beautiful-header-1
but BitBucket would do markdown-header-beautiful-header
then markdown-header-beautiful-header_1
, and I'm not sure about GitLab.
That being said I made an update with version 6.0.0 that defaults the unique slug start index to 1 instead of 2, and I also added an option to configure it (uniqueSlugStartIndex
), so you should definitely upgrade to version 6 or later to get the behavior that you want.
Let me know if that helps. Cheers!
Thanks a lot for your response and provided solution!
Hello,
coming from Joplin as I was told it uses this library for anchor generation.
I am gonna copy the issue I've written there.
Invalid header ID according to usual markdown rules.
Environment
Joplin version: Joplin 1.7.10 (prod, darwin) Platform: macOS OS specifics: Big Sur
Steps to reproduce
Beautiful header
First header.
Beautiful header
Second header.