aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2022-09-16 14:44:00 +0200
committerGitHub <noreply@github.com>2022-09-16 20:44:00 +0800
commit548387b2beaaaeb6b1c32c3c6f226b8f53aafecb (patch)
treeb755afd9aa43a20ef57604c7ade593e13eed35b0
parent8351172b6e5221290dc5b2c81e159e2eec0b43c8 (diff)
downloadgitea-548387b2beaaaeb6b1c32c3c6f226b8f53aafecb.tar.gz
gitea-548387b2beaaaeb6b1c32c3c6f226b8f53aafecb.zip
Show label description in comments section (#21156)
The labels in the comment section are currently missing the description that all other labels have.
-rw-r--r--modules/templates/helper.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index 2879d68e3b..a8e4075248 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -377,17 +377,17 @@ func NewFuncMap() []template.FuncMap {
return ""
},
"RenderLabels": func(labels []*issues_model.Label, repoLink string) template.HTML {
- html := `<span class="labels-list">`
+ htmlCode := `<span class="labels-list">`
for _, label := range labels {
// Protect against nil value in labels - shouldn't happen but would cause a panic if so
if label == nil {
continue
}
- html += fmt.Sprintf("<a href='%s/issues?labels=%d' class='ui label' style='color: %s !important; background-color: %s !important'>%s</a> ",
- repoLink, label.ID, label.ForegroundColor(), label.Color, RenderEmoji(label.Name))
+ htmlCode += fmt.Sprintf("<a href='%s/issues?labels=%d' class='ui label' style='color: %s !important; background-color: %s !important' title='%s'>%s</a> ",
+ repoLink, label.ID, label.ForegroundColor(), label.Color, html.EscapeString(label.Description), RenderEmoji(label.Name))
}
- html += "</span>"
- return template.HTML(html)
+ htmlCode += "</span>"
+ return template.HTML(htmlCode)
},
"MermaidMaxSourceCharacters": func() int {
return setting.MermaidMaxSourceCharacters