Skip to content

Commit 548387b

Browse files
authored
Show label description in comments section (#21156)
The labels in the comment section are currently missing the description that all other labels have.
1 parent 8351172 commit 548387b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/templates/helper.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,17 +377,17 @@ func NewFuncMap() []template.FuncMap {
377377
return ""
378378
},
379379
"RenderLabels": func(labels []*issues_model.Label, repoLink string) template.HTML {
380-
html := `<span class="labels-list">`
380+
htmlCode := `<span class="labels-list">`
381381
for _, label := range labels {
382382
// Protect against nil value in labels - shouldn't happen but would cause a panic if so
383383
if label == nil {
384384
continue
385385
}
386-
html += fmt.Sprintf("<a href='%s/issues?labels=%d' class='ui label' style='color: %s !important; background-color: %s !important'>%s</a> ",
387-
repoLink, label.ID, label.ForegroundColor(), label.Color, RenderEmoji(label.Name))
386+
htmlCode += fmt.Sprintf("<a href='%s/issues?labels=%d' class='ui label' style='color: %s !important; background-color: %s !important' title='%s'>%s</a> ",
387+
repoLink, label.ID, label.ForegroundColor(), label.Color, html.EscapeString(label.Description), RenderEmoji(label.Name))
388388
}
389-
html += "</span>"
390-
return template.HTML(html)
389+
htmlCode += "</span>"
390+
return template.HTML(htmlCode)
391391
},
392392
"MermaidMaxSourceCharacters": func() int {
393393
return setting.MermaidMaxSourceCharacters

0 commit comments

Comments
 (0)