Skip to content

Commit e20f8f0

Browse files
earl-warrenGusted
andauthored
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 <[email protected]>
1 parent 8833853 commit e20f8f0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

routers/web/user/profile.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,11 @@ func prepareUserProfileTabData(ctx *context.Context, showPrivate bool, profileGi
232232
if bytes, err := profileReadme.GetBlobContent(setting.UI.MaxDisplayFileSize); err != nil {
233233
log.Error("failed to GetBlobContent: %v", err)
234234
} else {
235-
if profileContent, err := markdown.RenderString(&markup.RenderContext{Ctx: ctx, GitRepo: profileGitRepo}, bytes); err != nil {
235+
if profileContent, err := markdown.RenderString(&markup.RenderContext{
236+
Ctx: ctx,
237+
GitRepo: profileGitRepo,
238+
Metas: map[string]string{"mode": "document"},
239+
}, bytes); err != nil {
236240
log.Error("failed to RenderString: %v", err)
237241
} else {
238242
ctx.Data["ProfileReadme"] = profileContent

web_src/css/user.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
}
123123

124124
#readme_profile {
125-
padding: 10px;
125+
padding: 1em 2em;
126126
border-radius: 0.28571429rem;
127127
background: var(--color-card);
128128
border: 1px solid var(--color-secondary);

0 commit comments

Comments
 (0)