]> source.dussan.org Git - gitea.git/commitdiff
Improve profile readme rendering (#25988)
authorEarl Warren <109468362+earl-warren@users.noreply.github.com>
Wed, 19 Jul 2023 22:22:32 +0000 (00:22 +0200)
committerGitHub <noreply@github.com>
Wed, 19 Jul 2023 22:22:32 +0000 (22:22 +0000)
- 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>
routers/web/user/profile.go
web_src/css/user.css

index 07a2261c967d3c866d2e04664cde31eeee958895..15a9197b980e89abc91afc6a93415f89f39a0c8b 100644 (file)
@@ -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
index 54a966e7cb471a2aef187157345404c447dcc61c..9fcdb3814aaad8beb7631215fa4a546305dc4ae5 100644 (file)
 }
 
 #readme_profile {
-  padding: 10px;
+  padding: 1em 2em;
   border-radius: 0.28571429rem;
   background: var(--color-card);
   border: 1px solid var(--color-secondary);