Gitea doesn’t create proper anchor links for headings specified as <hX> in the source
Normally a header within article is converted to an
<hX> HTML tag containing an
href attribute would contain the header title shaped to be conformant as an URL string. Like this:
## Second-level heading
<h2 id="user-content-second-level-heading"> ← id attribute is present <a href="#second-level-heading"> ← anchor is in place Second-level heading </a> </h2>
However, if we’d use HTML markup in the source file, e.g. to put the heading at the centre, the href attribute will contain only the hash sign,
<h2 align="center"> Second-level heading </h2>
<h2 align="center"> ← id attribute is missing! <a href="#"> ← anchor is empty! Second-level heading </a> </h2>
It breaks cross-references between articles, making them much less useful, and breaks compatibility with at least Github, where it works.
The issue template asked to mention, whether I have a Github account, and I actually don’t have one since this year.
I’m currently trying to migrate two repositories, one with code and one with the wiki. On the latter you can see the bug in action on basically any page there.
Take for example one of the pages with tips: there’s a table of contents at the top, and the links aren’t working, because the headings have an empty
href (sans the hash sign).
Deleting a branch is permanent. It CANNOT be undone. Continue?