diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 4e5c96cd0f..bb7a3476f2 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -364,13 +364,12 @@ func NewFuncMap() []template.FuncMap {
return ""
},
"RenderLabels": func(labels []*models.Label) template.HTML {
- html := ""
-
+ html := ``
for _, label := range labels {
- html = fmt.Sprintf("%s%s
",
- html, label.ForegroundColor(), label.Color, RenderEmoji(label.Name))
+ html += fmt.Sprintf("%s
",
+ label.ForegroundColor(), label.Color, RenderEmoji(label.Name))
}
-
+ html += ""
return template.HTML(html)
},
}}
diff --git a/templates/repo/issue/labels/labels_sidebar.tmpl b/templates/repo/issue/labels/labels_sidebar.tmpl
index bf6f98c888..1d61ecf3df 100644
--- a/templates/repo/issue/labels/labels_sidebar.tmpl
+++ b/templates/repo/issue/labels/labels_sidebar.tmpl
@@ -1,9 +1,11 @@
{{.ctx.i18n.Tr "repo.issues.new.no_label"}}
- {{range .ctx.Labels}}
- {{template "repo/issue/labels/label" dict "root" $ "label" .}}
- {{end}}
- {{range .ctx.OrgLabels}}
- {{template "repo/issue/labels/label" dict "root" $ "label" .}}
- {{end}}
+
+ {{range .ctx.Labels}}
+ {{template "repo/issue/labels/label" dict "root" $ "label" .}}
+ {{end}}
+ {{range .ctx.OrgLabels}}
+ {{template "repo/issue/labels/label" dict "root" $ "label" .}}
+ {{end}}
+
diff --git a/templates/shared/issuelist.tmpl b/templates/shared/issuelist.tmpl
index 9393583862..beb78a5491 100644
--- a/templates/shared/issuelist.tmpl
+++ b/templates/shared/issuelist.tmpl
@@ -37,9 +37,11 @@
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
{{end}}
{{end}}
- {{range .Labels}}
- {{.Name | RenderEmoji}}
- {{end}}
+
+ {{range .Labels}}
+ {{.Name | RenderEmoji}}
+ {{end}}
+