Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken anchor links in table of contents #135

Closed
baddy57 opened this issue Nov 10, 2022 · 2 comments
Closed

broken anchor links in table of contents #135

baddy57 opened this issue Nov 10, 2022 · 2 comments

Comments

@baddy57
Copy link

baddy57 commented Nov 10, 2022

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
Copy link
Owner

Doraku commented Nov 14, 2022

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
Copy link
Owner

Doraku commented Oct 23, 2024

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

@Doraku Doraku closed this as completed Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants