Skip to content

Make Markdown anchors match other major code hosting platforms #17262

Open
@benatkin

Description

@benatkin

Feature Description

Markdown anchors are generated from headings, and can be used relatively to link inside the code.

Gitea replaces spaces with dashes, while GitHub and GitLab omit the spaces.

GitHub and GitLab match, and Sourcehut mostly matches. I think it would be great if Gitea matched GitHub and GitLab, to ease the migration path.

This change would break links on Gitea repos that use them, but this could be fixed by making it remove the dashes, since it's already using JavaScript to move from #user-content-example-0-sign_in-ts to #example-0-sign_in-ts.

I'm working on Markdown code notebooks so I will likely rely on this more than most, but relative anchor links are used in other projects.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdated/theme/markdownpr/breakingMerging this PR means builds will break. Needs a description what exactly breaks, and how to fix it!type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions