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

markdown: commit archive link is rendered as broken commit link #30101

Closed
milahu opened this issue Mar 26, 2024 · 2 comments
Closed

markdown: commit archive link is rendered as broken commit link #30101

milahu opened this issue Mar 26, 2024 · 2 comments
Labels

Comments

@milahu
Copy link

milahu commented Mar 26, 2024

Description

when i put a commit archive link in markdown

https://try.gitea.io/milahu/test-gitea-markdown-wrong-commit-url/archive/c701ecde93ba762c2683f53c1af32ceb4f7a3f66.tar.gz

then gitea shows

c701ecde93.tar.gz

with the broken url

https://try.gitea.io/milahu/test-gitea-markdown-wrong-commit-url/archive/c701ecde93ba762c2683f53c1af32ceb4f7a3f66

when it should show

https://try.gitea.io/milahu/test-gitea-markdown-wrong-commit-url/archive/c701ecde93ba762c2683f53c1af32ceb4f7a3f66.tar.gz

branch archive links work as expected
so this seems to be an issue with the commit hash regex [0-9a-f]{40}

https://try.gitea.io/milahu/test-gitea-markdown-wrong-commit-url/archive/main.tar.gz

repro https://try.gitea.io/milahu/test-gitea-markdown-wrong-commit-url/src/branch/main/readme.md#commit-archive-links-in-markdown

ping @KN4CK3R via #28909 #29404

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?

.

Database

None

@milahu milahu changed the title markdown: commit archive link is rendered as commit link markdown: commit archive link is rendered as broken commit link Mar 26, 2024
@yp05327
Copy link
Contributor

yp05327 commented Mar 26, 2024

Detecting URL links in markdown has many problems.
Some similar problems:
#28015 #17958

@lunny
Copy link
Member

lunny commented Mar 26, 2024

Duplicate of #17958

@lunny lunny closed this as completed Mar 26, 2024
@lunny lunny marked this as a duplicate of #17958 Mar 26, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants