mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Show label description in comments section (#21156)
The labels in the comment section are currently missing the description that all other labels have.
This commit is contained in:
		@@ -377,17 +377,17 @@ func NewFuncMap() []template.FuncMap {
 | 
				
			|||||||
			return ""
 | 
								return ""
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		"RenderLabels": func(labels []*issues_model.Label, repoLink string) template.HTML {
 | 
							"RenderLabels": func(labels []*issues_model.Label, repoLink string) template.HTML {
 | 
				
			||||||
			html := `<span class="labels-list">`
 | 
								htmlCode := `<span class="labels-list">`
 | 
				
			||||||
			for _, label := range labels {
 | 
								for _, label := range labels {
 | 
				
			||||||
				// Protect against nil value in labels - shouldn't happen but would cause a panic if so
 | 
									// Protect against nil value in labels - shouldn't happen but would cause a panic if so
 | 
				
			||||||
				if label == nil {
 | 
									if label == nil {
 | 
				
			||||||
					continue
 | 
										continue
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				html += fmt.Sprintf("<a href='%s/issues?labels=%d' class='ui label' style='color: %s !important; background-color: %s !important'>%s</a> ",
 | 
									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, RenderEmoji(label.Name))
 | 
										repoLink, label.ID, label.ForegroundColor(), label.Color, html.EscapeString(label.Description), RenderEmoji(label.Name))
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			html += "</span>"
 | 
								htmlCode += "</span>"
 | 
				
			||||||
			return template.HTML(html)
 | 
								return template.HTML(htmlCode)
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		"MermaidMaxSourceCharacters": func() int {
 | 
							"MermaidMaxSourceCharacters": func() int {
 | 
				
			||||||
			return setting.MermaidMaxSourceCharacters
 | 
								return setting.MermaidMaxSourceCharacters
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user