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

Wrong Link when referencing a commit hash on README.md #4536

Closed
1 of 3 tasks
krombel opened this issue Jul 28, 2018 · 3 comments · Fixed by #6645
Closed
1 of 3 tasks

Wrong Link when referencing a commit hash on README.md #4536

krombel opened this issue Jul 28, 2018 · 3 comments · Fixed by #6645
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Milestone

Comments

@krombel
Copy link

krombel commented Jul 28, 2018

  • Gitea version (or commit ref): 1.5.0+rc2-2-g5a7830e0e

  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No (Bad Gateway)
    • Not relevant

Description

When adding a commit hash to README.md the hash gets linkyfied to
http://host/testOrg/testRepo1/src/branch/master/commit/<commitID> instead of
http://host/testOrg/testRepo1/commit/<commitID>

@SagePtr
Copy link
Contributor

SagePtr commented Jul 29, 2018

Also, in /api/v1/markdown preview (while editing file through web), not only for commit references wrong link href is generated, but for issue links too.
Example markdown:

# test

Commit 056dd42

Issue #1

Result is:

<h1>test</h1>

<p>Commit <a href="https://{domain}/{user}/{repo}/src/branch/master/commit/056dd42" rel="nofollow">056dd42</a></p>

<p>Issue <a href="https://{domain}/{user}/{repo}/src/branch/master/issues/1" rel="nofollow">#1</a></p>

Should be:

<h1>test</h1>

<p>Commit <a href="https://{domain}/{user}/{repo}/commit/056dd42" rel="nofollow">056dd42</a></p>

<p>Issue <a href="https://{domain}/{user}/{repo}/issues/1" rel="nofollow">#1</a></p>

@lunny lunny added this to the 1.5.1 milestone Aug 24, 2018
@techknowlogick techknowlogick modified the milestones: 1.5.1, 1.5.2 Sep 2, 2018
@techknowlogick techknowlogick modified the milestones: 1.5.2, 1.7.0 Oct 9, 2018
@techknowlogick techknowlogick modified the milestones: 1.7.0, 1.8.0 Dec 27, 2018
@stale
Copy link

stale bot commented Feb 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Feb 25, 2019
@lunny
Copy link
Member

lunny commented Feb 28, 2019

Since #4545 moved to 1.9.0, move this to 1.9.0 too.

@stale stale bot removed the issue/stale label Feb 28, 2019
@lunny lunny modified the milestones: 1.8.0, 1.9.0 Feb 28, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Feb 28, 2019
mrsdizzie added a commit to mrsdizzie/gitea that referenced this issue Apr 16, 2019
Since go-gitea#6273 was merged, we now have access to proper context metas
always. Update SHA generated links to use these instead of urlPrefix.

Update tests as well.

Fixes go-gitea#4536.
zeripath pushed a commit that referenced this issue Apr 16, 2019
Since #6273 was merged, we now have access to proper context metas
always. Update SHA generated links to use these instead of urlPrefix.

Update tests as well.

Fixes #4536.
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug
Projects
None yet
5 participants