1
0
Fork 0
forked from forgejo/forgejo

Respect branch info for relative links (#28909)

Fix #28904

Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
KN4CK3R 2024-01-25 09:54:44 +01:00 committed by GitHub
parent eaab89c46b
commit c46316f7ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -137,6 +137,8 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
var base string
if ctx.IsWiki {
base = ctx.Links.WikiLink()
} else if ctx.Links.HasBranchInfo() {
base = ctx.Links.SrcLink()
} else {
base = ctx.Links.Base
}