mirror of
https://github.com/go-gitea/gitea
synced 2025-07-07 19:17:21 +00:00
Links in markdown should be absolute to the repository not the server (#15088)
* Links in markdown should be absolute to the repository not the server Fix #15075 Signed-off-by: Andrew Thornton <art27@cantab.net> * match github Signed-off-by: Andrew Thornton <art27@cantab.net> * add testcase Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
@ -98,7 +98,8 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
|
||||
}
|
||||
prefix = strings.Replace(prefix, "/src/", "/media/", 1)
|
||||
|
||||
lnk := string(link)
|
||||
lnk := strings.TrimLeft(string(link), "/")
|
||||
|
||||
lnk = giteautil.URLJoin(prefix, lnk)
|
||||
link = []byte(lnk)
|
||||
}
|
||||
|
Reference in New Issue
Block a user