diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 4e5c96cd0fa7..bb7a3476f29b 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 bf6f98c88860..1d61ecf3df5b 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 93935838628e..beb78a54914b 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}}
+