Skip to content

Certain markdown links not working in Gitlab #72

@mnich0ls

Description

@mnich0ls

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions