Links in markdown should be absolute to the repository not the server#15088
Conversation
Fix go-gitea#15075 Signed-off-by: Andrew Thornton <art27@cantab.net>
|
Can you add some unit tests? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Ugh actually the situation is more complex indeed. Take a look at https://github.com/zeripath/pathological/blob/master/README.md |
This comment has been minimized.
This comment has been minimized.
…ence-link-relative-paths
…ence-link-relative-paths
Signed-off-by: Andrew Thornton <art27@cantab.net>
|
Fixed this! It should now replicate the GH way. |
Signed-off-by: Andrew Thornton <art27@cantab.net>
|
So the absolute path to site will break. I think we should mark this as break. |
|
Well... The current behaviour is a bug when compared to GitHub compatibility. Do we know what gitlab does? If we can show that gitlab doesn't behave the same then we can probably make it a flag etc. |
|
gitlab example: https://gitlab.com/real6543/pathological/-/blob/master/README.md |
Codecov Report
@@ Coverage Diff @@
## master #15088 +/- ##
=======================================
Coverage 43.93% 43.93%
=======================================
Files 677 677
Lines 81332 81332
=======================================
Hits 35732 35732
+ Misses 39804 39799 -5
- Partials 5796 5801 +5
Continue to review full report at Codecov.
|
|
Any reason not to backport this to 1.14? |
Currently Gitea will render links like:
as being absolute with respect to the server when they should be relative to the repository prefix in order to be github compatible.
Fix #15075
This represents a change in the rendering of these links - however, it makes them match Github so the previous behaviour was a bug.
Signed-off-by: Andrew Thornton art27@cantab.net