diff --git a/routers/web/map/umap.go b/routers/web/map/umap.go index 7032b70909..a91334cdc9 100644 --- a/routers/web/map/umap.go +++ b/routers/web/map/umap.go @@ -15,6 +15,9 @@ import ( "code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" + "code.gitea.io/gitea/modules/markup" + "code.gitea.io/gitea/modules/markup/markdown" + ) const ( @@ -76,6 +79,22 @@ func RenderUserSearch(ctx *context.Context, opts *user_model.SearchUserOptions, } } + for i := range users { + if len(users[i].Description) != 0 { + content, err := markdown.RenderString(&markup.RenderContext{ + URLPrefix: ctx.Repo.RepoLink, + Metas: map[string]string{"mode": "document"}, + GitRepo: ctx.Repo.GitRepo, + Ctx: ctx, + }, users[i].Description) + if err != nil { + ctx.ServerError("RenderString", err) + return + } + users[i].Description = content + } + } + ctx.Data["Keyword"] = opts.Keyword ctx.Data["Total"] = count ctx.Data["Users"] = users diff --git a/templates/map/umap.tmpl b/templates/map/umap.tmpl index 83e1143805..a13e4cb1b5 100644 --- a/templates/map/umap.tmpl +++ b/templates/map/umap.tmpl @@ -2822,7 +2822,7 @@ {{range .Users}} {{if .LocationCoordinate}} - [parseFloat({{.LocationCoordinate}}.split(',')[0]) , parseFloat({{.LocationCoordinate}}.split(',')[1]), "{{avatar .}} {{.HomeLink}} {{.FullName}} {{.Description}}"], + [parseFloat({{.LocationCoordinate}}.split(',')[0]) , parseFloat({{.LocationCoordinate}}.split(',')[1]), "{{avatar .}} {{.HomeLink}} {{.FullName}}
  • {{.Description | Str2html}}
  • "], {{end}} {{else}}