wrong permalink to html heading in markdown file #11760

Open
opened 2025-11-02 09:47:00 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @milahu on GitHub (Oct 1, 2023).

Description

in a markdown file, put the html heading

<h1>Heading without ID</h1>

then gitea blob API will generate the wrong permalink # for that heading.
github blob API would generate the permalink #heading-without-id

if the html heading has an id
gitea blob API renders the correct permalink #heading-with-id

<h1 id="heading-with-id">Heading with ID</h1>

compare:

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

im using some gitea instances, i dont know how they are running gitea...

Database

None

Originally created by @milahu on GitHub (Oct 1, 2023). ### Description in a markdown file, put the html heading ``` <h1>Heading without ID</h1> ``` then gitea blob API will generate the wrong permalink `#` for that heading. github blob API would generate the permalink `#heading-without-id` if the html heading has an id gitea blob API renders the correct permalink `#heading-with-id` ``` <h1 id="heading-with-id">Heading with ID</h1> ``` compare: - https://github.com/milahu/gitea-html-in-markdown-render-bug - https://try.gitea.io/milahu/gitea-html-in-markdown-render-bug # gitea 1.22.0 - https://codeberg.org/milahu/gitea-html-in-markdown-render-bug ### Gitea Version 1.22.0 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? im using some gitea instances, i dont know how they are running gitea... ### Database None
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 09:47:00 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11760