diff options
author | wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf <61180606+wULLSnpAXbWZGYDYyhWTKKspEQoaYxXyhoisqHf@users.noreply.github.com> | 2020-11-15 17:28:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-15 16:28:08 +0000 |
commit | 3ea237b333a963ad8298367edcaad1b2988f7054 (patch) | |
tree | 07e2c1d4e0fe99d4a0beaccaa0b8c643eea07f6c /routers/org/home.go | |
parent | d025d84d91a43a691d748323cd74d0fdc5ecc9bf (diff) | |
download | gitea-3ea237b333a963ad8298367edcaad1b2988f7054.tar.gz gitea-3ea237b333a963ad8298367edcaad1b2988f7054.zip |
Add markdown support in organization description (#13549)
Similarly to how you can write some markdown in user profile description, you can now use the same feature in organization description.
As discussed in discord.
kudos to @mrsdizzie and @zeripath
visualization:
![image](https://user-images.githubusercontent.com/61180606/99115919-8004a200-25f3-11eb-8bbd-ab33de2cabb3.png)
Diffstat (limited to 'routers/org/home.go')
-rw-r--r-- | routers/org/home.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/org/home.go b/routers/org/home.go index 9ca0258784..ff3e1e3e72 100644 --- a/routers/org/home.go +++ b/routers/org/home.go @@ -10,6 +10,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/markup/markdown" "code.gitea.io/gitea/modules/setting" ) @@ -34,6 +35,9 @@ func Home(ctx *context.Context) { ctx.Data["PageIsUserProfile"] = true ctx.Data["Title"] = org.DisplayName() + if len(org.Description) != 0 { + ctx.Data["RenderedDescription"] = string(markdown.Render([]byte(org.Description), ctx.Repo.RepoLink, map[string]string{"mode": "document"})) + } var orderBy models.SearchOrderBy ctx.Data["SortType"] = ctx.Query("sort") |