Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue comment URLs parsed / emitted incorrectly #17394

Closed
noerw opened this issue Oct 21, 2021 · 5 comments · Fixed by #17411
Closed

Issue comment URLs parsed / emitted incorrectly #17394

noerw opened this issue Oct 21, 2021 · 5 comments · Fixed by #17411

Comments

@noerw
Copy link
Member

noerw commented Oct 21, 2021

Gitea Version

a115309 (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

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Oct 22, 2021

Somehow related to #17398 , maybe the code can be improved more.

It is a Markdown rendering problem.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented 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
Copy link
Contributor

Fixed in #17404

@noerw
Copy link
Member Author

noerw commented Oct 23, 2021

just noted that 1.15.5 is affected too

@wxiaoguang
Copy link
Contributor

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

wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Oct 23, 2021
* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close go-gitea#17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close go-gitea#17395
wxiaoguang added a commit that referenced this issue Oct 23, 2021
* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close #17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close #17395
wxiaoguang added a commit to wxiaoguang/gitea that referenced this issue Oct 23, 2021
* Bug fix: render Markdown `http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test` to HTML correctly, close go-gitea#17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close go-gitea#17395

# Conflicts:
#	modules/markup/html.go
lunny pushed a commit that referenced this issue Oct 23, 2021
* Bug fix: render Markdown `http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test` to HTML correctly, close #17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close #17395

# Conflicts:
#	modules/markup/html.go
Chianina pushed a commit to Chianina/gitea that referenced this issue Mar 28, 2022
* Bug fix: render Markdown http://AppURL/org/repo/issues/4?a=1&b=2#comment-123 test to HTML correctly, close go-gitea#17394
* Bug fix: fix the positions of checkboxes in rendered HTML, close go-gitea#17395
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants