summaryrefslogtreecommitdiffstats
path: root/routers/common
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2024-03-13 11:34:58 +0100
committerGitHub <noreply@github.com>2024-03-13 10:34:58 +0000
commit85c59d6c21e10ef9d3ccf11713548f50e47e920f (patch)
tree3d6208785763a7e5aa3b2f5ad47e9fc8032b7f0e /routers/common
parent66edc888ee8b2f77a6f11139acd2d03c561ad5ef (diff)
downloadgitea-85c59d6c21e10ef9d3ccf11713548f50e47e920f.tar.gz
gitea-85c59d6c21e10ef9d3ccf11713548f50e47e920f.zip
Use relative links for commits, mentions, and issues in markdown (#29427)
Fixes #29404 Use relative links for - commits - mentions - issues --------- Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'routers/common')
-rw-r--r--routers/common/markup.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/common/markup.go b/routers/common/markup.go
index 7819ee7227..2d5638ef61 100644
--- a/routers/common/markup.go
+++ b/routers/common/markup.go
@@ -34,7 +34,8 @@ func RenderMarkup(ctx *context.Base, repo *context.Repository, mode, text, urlPr
if err := markdown.RenderRaw(&markup.RenderContext{
Ctx: ctx,
Links: markup.Links{
- Base: urlPrefix,
+ AbsolutePrefix: true,
+ Base: urlPrefix,
},
}, strings.NewReader(text), ctx.Resp); err != nil {
ctx.Error(http.StatusInternalServerError, err.Error())
@@ -79,7 +80,8 @@ func RenderMarkup(ctx *context.Base, repo *context.Repository, mode, text, urlPr
if err := markup.Render(&markup.RenderContext{
Ctx: ctx,
Links: markup.Links{
- Base: urlPrefix,
+ AbsolutePrefix: true,
+ Base: urlPrefix,
},
Metas: meta,
IsWiki: wiki,