aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routers/user/profile.go5
-rw-r--r--templates/user/profile.tmpl5
2 files changed, 7 insertions, 3 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go
index 82fab4ad87..653d3cea22 100644
--- a/routers/user/profile.go
+++ b/routers/user/profile.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
+ "code.gitea.io/gitea/modules/markup/markdown"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/routers/org"
@@ -97,6 +98,10 @@ func Profile(ctx *context.Context) {
// so everyone would get the same empty heatmap
ctx.Data["EnableHeatmap"] = setting.Service.EnableUserHeatmap && !ctxUser.KeepActivityPrivate
ctx.Data["HeatmapUser"] = ctxUser.Name
+ if len(ctxUser.Description) != 0 {
+ ctx.Data["RenderedDescription"] = string(markdown.Render([]byte(ctxUser.Description), ctx.Repo.RepoLink, map[string]string{"mode": "document"}))
+ }
+
showPrivate := ctx.IsSigned && (ctx.User.IsAdmin || ctx.User.ID == ctxUser.ID)
orgs, err := models.GetOrgsByUserID(ctxUser.ID, showPrivate)
diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl
index 563bc78307..bc2960b3b9 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -34,10 +34,9 @@
<a target="_blank" rel="noopener noreferrer me" href="{{.Owner.Website}}">{{.Owner.Website}}</a>
</li>
{{end}}
- {{if .Owner.Description}}
+ {{if $.RenderedDescription}}
<li>
- {{svg "octicon-info" 16}}
- <span>{{.Owner.Description}}</span>
+ <div class="render-content markdown">{{$.RenderedDescription|Str2html}}</div>
</li>
{{end}}
{{range .OpenIDs}}