aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorSergey Dryabzhinsky <sergey.dryabzhinsky@gmail.com>2018-05-29 01:42:27 +0300
committer无闻 <u@gogs.io>2018-05-29 06:42:27 +0800
commitb5a1daa756b181f15a1318a53aba09478b988e6a (patch)
tree3fbb3cafd2965dbd07e7bada2aa6d2914f503d9e /templates
parent5a47301dbd85e8d3c240cdf2eb248974b7fe5f06 (diff)
template: simple html filter for repository description (#5242)
* Add markdown renderer function to templates, use it for description in repo template * Fix function call * Define function Md2html in template namespace * Change filter from Md2html to nl2br * Change filter name to NewLine2br as suggested * Update description output: - just replace `\n` by `<br>` - sanitize html after replace
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/home.tmpl2
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl
index ce49e380..843ec5d0 100644
--- a/templates/repo/home.tmpl
+++ b/templates/repo/home.tmpl
@@ -5,7 +5,7 @@
{{template "base/alert" .}}
{{if .PageIsRepoHome}}
<p id="repo-desc">
- {{if .Repository.Description}}<span class="description has-emoji">{{.Repository.Description | Str2html}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
+ {{if .Repository.Description}}<span class="description has-emoji">{{.Repository.Description | NewLine2br | Str2html}}</span>{{else}}<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>{{end}}
<a class="link" href="{{.Repository.Website}}">{{.Repository.Website}}</a>
</p>
<div class="ui segment" id="git-stats">