Open
Description
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.
- GitHub: https://github.com/ResourcesCo/macchiato/blob/main/auth/indieauth.md#example0sign_ints
- GitLab: https://gitlab.com/ResourcesCo/macchiato/macchiato/-/blob/main/auth/indieauth.md#example0sign_ints
- Gitea adds dashes: https://gitea.com/ResourcesCo/macchiato/src/branch/main/auth/indieauth.md#example-0-sign_in-ts
- BitBucket prefixes (so do others, but they have JavaScript to make the anchors work): https://bitbucket.org/resourcesco/macchiato/src/main/auth/indieauth.md#markdown-header-example0sign_ints
- SourceHut adds
code
when the header is an inline code block: https://git.sr.ht/~benatkin/macchiato/tree/main/item/auth/indieauth.md#codeexample0sign_intscode
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