mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-08-02 14:32:33 +08:00
Allow issue templates to not render title (#22589)
This adds a yaml attribute that will allow the option for when markdown is rendered that the title will be not included in the output Based on work from @brechtvl
This commit is contained in:
@ -259,7 +259,9 @@ func (f *valuedField) WriteTo(builder *strings.Builder) {
|
||||
}
|
||||
|
||||
// write label
|
||||
_, _ = fmt.Fprintf(builder, "### %s\n\n", f.Label())
|
||||
if !f.HideLabel() {
|
||||
_, _ = fmt.Fprintf(builder, "### %s\n\n", f.Label())
|
||||
}
|
||||
|
||||
blankPlaceholder := "_No response_\n"
|
||||
|
||||
@ -311,6 +313,13 @@ func (f *valuedField) Label() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (f *valuedField) HideLabel() bool {
|
||||
if label, ok := f.Attributes["hide_label"].(bool); ok {
|
||||
return label
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (f *valuedField) Render() string {
|
||||
if render, ok := f.Attributes["render"].(string); ok {
|
||||
return render
|
||||
|
Reference in New Issue
Block a user