Doraku / DefaultDocumentation

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

broken anchor links in table of contents #135

Open baddy57 opened 1 year ago

baddy57 commented 1 year 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 1 year 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?