@@ -16,6 +16,8 @@ import (
1616 "code.gitea.io/gitea/modules/git"
1717 "code.gitea.io/gitea/modules/gitrepo"
1818 "code.gitea.io/gitea/modules/log"
19+ "code.gitea.io/gitea/modules/markup"
20+ "code.gitea.io/gitea/modules/markup/markdown"
1921 "code.gitea.io/gitea/modules/optional"
2022 "code.gitea.io/gitea/modules/setting"
2123 "code.gitea.io/gitea/services/context"
@@ -34,6 +36,7 @@ func prepareContextForCommonProfile(ctx *context.Context) {
3436func PrepareContextForProfileBigAvatar (ctx * context.Context ) {
3537 prepareContextForCommonProfile (ctx )
3638
39+ ctx .Data ["IsFollowing" ] = ctx .Doer != nil && user_model .IsFollowing (ctx , ctx .Doer .ID , ctx .ContextUser .ID )
3740 ctx .Data ["ShowUserEmail" ] = setting .UI .ShowUserEmail && ctx .ContextUser .Email != "" && ctx .IsSigned && ! ctx .ContextUser .KeepEmailPrivate
3841 if setting .Service .UserLocationMapURL != "" {
3942 ctx .Data ["ContextUserLocationMapURL" ] = setting .Service .UserLocationMapURL + url .QueryEscape (ctx .ContextUser .Location )
@@ -45,6 +48,17 @@ func PrepareContextForProfileBigAvatar(ctx *context.Context) {
4548 return
4649 }
4750 ctx .Data ["OpenIDs" ] = openIDs
51+ if len (ctx .ContextUser .Description ) != 0 {
52+ content , err := markdown .RenderString (& markup.RenderContext {
53+ Metas : map [string ]string {"mode" : "document" },
54+ Ctx : ctx ,
55+ }, ctx .ContextUser .Description )
56+ if err != nil {
57+ ctx .ServerError ("RenderString" , err )
58+ return
59+ }
60+ ctx .Data ["RenderedDescription" ] = content
61+ }
4862
4963 showPrivate := ctx .IsSigned && (ctx .Doer .IsAdmin || ctx .Doer .ID == ctx .ContextUser .ID )
5064 orgs , err := db .Find [organization.Organization ](ctx , organization.FindOrgOptions {
0 commit comments