Doraku / DefaultDocumentation

Create a simple markdown documentation from the Visual Studio xml one.
MIT No Attribution
160 stars 26 forks source link

broken anchor links in table of contents #135

Closed baddy57 closed 1 month ago

baddy57 commented 2 years ago

Hi, I tried using your tool with --Sections "TableOfContents". I noticed that the anchor links generated are broken, because the url refers to the full name of the items ("file.md#namespace.classname") while the titles marked with '#' are written differently ("classname class"), so the urls should be like "file.md#classname-class" "file.md#method()-Method" (with escaped parenthesis) etc..

i think the problem might be in DefaultDocumentation.Markdown.UrlFactories.DocItemFactory line 48

url += "#" + PathCleaner.Clean(item.FullName, context.GetInvalidCharReplacement());

example: table of contents:

- **[ErrorHandlerController](EmsRepositoryWebApp.Controllers.V1.md#EmsRepositoryWebApp.Controllers.V1.ErrorHandlerController 'EmsRepositoryWebApp.Controllers.V1.ErrorHandlerController')**

actual header

## ErrorHandlerController Class

Doraku commented 2 years ago

hum normally there should be a <a name='EmsRepositoryWebApp.Controllers.V1.ErrorHandlerController'/> target on the page that correspond to the actual link target, or is there some markdown interpretation that automatically try to link to the ## Header title instead?

Doraku commented 1 month ago

cleaning up old issues, feel free to reopen if you still need assistance.