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>
(cherry picked from commit 85c59d6c21e10ef9d3ccf11713548f50e47e920f)
This commit is contained in:
KN4CK3R 2024-03-13 11:34:58 +01:00 committed by Earl Warren
parent e2abfdc3a4
commit 024bfb7f34
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
9 changed files with 65 additions and 26 deletions

View file

@ -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,