xoofx / markdig

A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
BSD 2-Clause "Simplified" License
4.21k stars 444 forks source link

AutoIdentifierOptions.GitHub should remove dots from anchor links #218

Closed Jeavon closed 6 years ago

Jeavon commented 6 years ago

On GitHub ### Thing (v7.7.3+) produces a anchor of #thing-v773 However when using markdig we get a anchor of #thing-v7.7.3

So when AutoIdentifierOptions.GitHub is used the dots should be removed from the anchors

xoofx commented 6 years ago

this should be removed (typically all the links at scriban were generated with Markdig) and looking at the markdig code:

https://github.com/lunet-io/markdig/blob/964538ec79270741463ba207fda6e151f527248e/src/Markdig/Helpers/LinkHelper.cs#L100-L115

it does keep only letter, digit, -, _ but I don't see any .

So not sure exactly how did you get your result?

Jeavon commented 6 years ago

@xoofx I'm not sure if I'm doing something wrong then, perhaps the attached helps? image

Jeavon commented 6 years ago

Checked we weren't doing anything to the heading before passing into Markdig

image

xoofx commented 6 years ago

UseAdvancedExtensions().UseAutoIdentifiers(...) will not work as the extension is already added by UseAdvancedExtensions. Try to issue the UseAutoIdentifiers before

Jeavon commented 6 years ago

That's got it, thanks so much @xoofx !