Description
- Gitea version (or commit ref): 1.12.1
- Git version: 2.20.1
- Operating system: Debian 10
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL) https://try.gitea.io/annelauref/TEST_prefix_ID
- No
- Not relevant
- Log gist:
Description
Since #9477 the web interface adds a "user-content-" prefix to IDs in markup files.
The internal links [link to internal anchor](#my-anchor)
are correctly updated with the prefix, but links to an anchor of another file are not. This makes the link point to a non existing ID and navigation ends up at the top of the other page.
This breaks navigation between long markup files.
Tested with markdown files in repository, and in the wiki pages, as you can see in the test repo https://try.gitea.io/annelauref/TEST_prefix_ID
I think a solution would be to add the prefix to anchors in relative links.
Edited to say: manually adding user-content- to links between file could be a workaround for some repos but it is confusing (needed for some links but no all) and breaks compatibility with at least Github (for me it's happening on a repo that has multiple remotes, one on an internal Gitea server and one on Github)