Skip to content

Commit

Permalink
Show label description in comments section (#21156)
Browse files Browse the repository at this point in the history
The labels in the comment section are currently missing the description that all other labels have.
  • Loading branch information
JakobDev authored Sep 16, 2022
1 parent 8351172 commit 548387b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/templates/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 548387b

Please sign in to comment.