Issue comment URLs parsed / emitted incorrectly #8006

Closed
opened 2025-11-02 07:47:43 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @noerw on GitHub (Oct 21, 2021).

Gitea Version

a115309f4 (current 1.16), but I observed this since early in the 1.16 dev cycle

Git Version

No response

Operating System

No response

How are you running Gitea?

try.gitea.io

Database

No response

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://try.gitea.io/noerw/hochwasser/issues/5

Description

Issue comment references don't get parsed correctly, when it isn't the last thing on the line.
Looks like the HTML emitted is wrong, the word following the link is missing. The href is empty.
See try.gitea.io link above.

Screenshots

No response

Originally created by @noerw on GitHub (Oct 21, 2021). ### Gitea Version a115309f4 (current 1.16), but I observed this since early in the 1.16 dev cycle ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? try.gitea.io ### Database _No response_ ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist https://try.gitea.io/noerw/hochwasser/issues/5 ### Description Issue comment references don't get parsed correctly, when it isn't the last thing on the line. Looks like the HTML emitted is wrong, the word following the link is missing. The href is empty. See try.gitea.io link above. ### Screenshots _No response_
GiteaMirror added the outdated/theme/markdowntype/bug labels 2025-11-02 07:47:43 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Oct 22, 2021):

Somehow related to https://github.com/go-gitea/gitea/pull/17398 , maybe the code can be improved more.

It is a Markdown rendering problem.

@wxiaoguang commented on GitHub (Oct 22, 2021): ~~Somehow related to https://github.com/go-gitea/gitea/pull/17398 , maybe the code can be improved more.~~ It is a Markdown rendering problem.
Author
Owner

@wxiaoguang commented on GitHub (Oct 23, 2021):

The problem is caused by the wrong HTML generated.

For example:

http://127.0.0.1:3000/root/test/issues/1#comment test

The genrated HTML is

<p><a href="http://127.0.0.1:3000/root/test/issues/1#comment test" class="ref-issue">#1</a></p>

Then SanitizeReader removes the invalid href.

@wxiaoguang commented on GitHub (Oct 23, 2021): The problem is caused by the wrong HTML generated. For example: ``` http://127.0.0.1:3000/root/test/issues/1#comment test ``` The genrated HTML is ``` <p><a href="http://127.0.0.1:3000/root/test/issues/1#comment test" class="ref-issue">#1</a></p> ``` Then SanitizeReader removes the invalid href.
Author
Owner

@wxiaoguang commented on GitHub (Oct 23, 2021):

Fixed in https://github.com/go-gitea/gitea/pull/17404

@wxiaoguang commented on GitHub (Oct 23, 2021): Fixed in https://github.com/go-gitea/gitea/pull/17404
Author
Owner

@noerw commented on GitHub (Oct 23, 2021):

just noted that 1.15.5 is affected too

@noerw commented on GitHub (Oct 23, 2021): just noted that 1.15.5 is affected too
Author
Owner

@wxiaoguang commented on GitHub (Oct 23, 2021):

Yep, this is a very old bug, we can make a backport then

@wxiaoguang commented on GitHub (Oct 23, 2021): Yep, this is a very old bug, we can make a backport then
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#8006