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

Certain markdown links not working in Gitlab #72

Open
mnich0ls opened this issue Jul 28, 2022 · 0 comments
Open

Certain markdown links not working in Gitlab #72

mnich0ls opened this issue Jul 28, 2022 · 0 comments

Comments

@mnich0ls
Copy link
Contributor

Gitlab seems to have slightly different rules for how it escapes spaces for it's anchor links: https://docs.gitlab.com/ee/user/markdown.html#header-ids-and-links

This causes the links generated for the index/TOC, to not work when a string has a hyphen surrounded by spaces e.g "/api/example - success"

Docgen will make a link such as: [/api/example - success](#apiexample-success)

However Gitlab will create an anchor ID such as: id=apiexample---success

I tried to look at the function that generates links, but I can't seem to find the source of the function:

"glink": githubLink,

I don't know what the right answer to this problem is, since changing the behavior will have a breaking effect for Markdown pages rendered by Github or Chrome where they seem to have slightly different behavior for the anchor tag links (header IDs). Maybe we can have a "gitlab" flag that allows the links to be generated/escaped using the same rules Gitlab follows?

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

1 participant