-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 links started with / broken in 1.23 #33274
Comments
@wxiaoguang FYI since you refactored that part. I think current behavior is more correct and mirroring github one. Though it wasn't marked as a breaking change. |
@TheFox0x7 I read this github blog post and related documentation page and can't find any information about links with leading Okay, relative links without leading |
Fair enough, I missed that there's no What I gather is that you want the I think changing this line to be just link would cover that, though then the nested absolute path test fails and I'm not sure whats the purpose of the |
Yup, it's not broken but just follows other git service's behavior like GitHub. If you'd like to cross-reference the documents, it needs to use use full link (with Sorry for the "breaking" change, because there are more stronger requirements for it:
ps: I see you are using "readme" for an org, actually there is a feature "profile readme", you could put the readme in |
@TheFox0x7 yep, and tests that you mentioned above written in opposite approach.
@wxiaoguang yes, that's true. But "as others" not always means "better", right? Previous approach was more flexible, allows choice between absolute and relative links using leading /, and for now no more choice. My proposal is: if this is not too hard to implement, could you make this behaviour configurable via app.ini? Something like
Readme is just an example. Actually all our cross-repo links (hundreds of them) such as code reference in issues, documentation and so on were written in that manner for portability reason (changing base domain (especially port number) of gitea instance do not broke these links). |
This |
I do not think |
Yea we'd need a "origin-relative" or "suburl-relative" URL, but there is no standard for that as far as I'm aware. Maybe |
Description
If you paste a link tag in any place (MD files, issues, comments) started with leading
/
(without domain) it don't works anymore in 1.23. I'm not sure about 1.22.5 or 1.22.6 but for 1.22.4 or older version this kind of links works perfectly: parsed as absolute URL for whole Gitea instance (domain). For now these liks are parsed as relative to current repository.For example, if you want to link other repo now you need to specify full URL, including domain and port (if customized). In case of transfer Gitea instance to another domain/port it seems to be better to use absolute URLs without domain.
This change broken all our documentation system and old conversation in issues, please, fix it!
Gitea Version
1.23.1
Can you reproduce the bug on the Gitea demo site?
Yes
MD: https://demo.gitea.com/didim99/test-2/src/branch/master/readme.md
Issues: https://demo.gitea.com/didim99/test/issues/1#issue-798
Log Gist
No response
Screenshots
No response
Git Version
Not matters
Operating System
Not matters
How are you running Gitea?
Official install script (updated from 1.22.6)
Database
MySQL/MariaDB
The text was updated successfully, but these errors were encountered: