aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/user/profile.go
diff options
context:
space:
mode:
authorEarl Warren <109468362+earl-warren@users.noreply.github.com>2023-07-20 00:22:32 +0200
committerGitHub <noreply@github.com>2023-07-19 22:22:32 +0000
commite20f8f097759699375b029430174439c644881bc (patch)
tree34461588351fad21126ec360599e7d1a5ca62e37 /routers/web/user/profile.go
parent8833853dd6bd137c6b372f2f206275664679d919 (diff)
downloadgitea-e20f8f097759699375b029430174439c644881bc.tar.gz
gitea-e20f8f097759699375b029430174439c644881bc.zip
Improve profile readme rendering (#25988)
- Tell the renderer to use the `document` mode, so it's consistent with other renderers. - Use the same padding as `.file-view.markup`, so it's consistent with other containers that contain markup rendering. - Resolves https://codeberg.org/forgejo/forgejo/issues/833 Co-authored-by: Gusted <postmaster@gusted.xyz>
Diffstat (limited to 'routers/web/user/profile.go')
-rw-r--r--routers/web/user/profile.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/user/profile.go b/routers/web/user/profile.go
index 07a2261c96..15a9197b98 100644
--- a/routers/web/user/profile.go
+++ b/routers/web/user/profile.go
@@ -232,7 +232,11 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileGi
if bytes, err := profileReadme.GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil {
log.Error("failed to GetBlobContent: %v", err)
} else {
- if profileContent, err := markdown.RenderString(&markup.RenderContext{Ctx: ctx, GitRepo: profileGitRepo}, bytes); err != nil {
+ if profileContent, err := markdown.RenderString(&markup.RenderContext{
+ Ctx: ctx,
+ GitRepo: profileGitRepo,
+ Metas: map[string]string{"mode": "document"},
+ }, bytes); err != nil {
log.Error("failed to RenderString: %v", err)
} else {
ctx.Data["ProfileReadme"] = profileContent