mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Deal with markdown template without metadata (#21639)
Fixed #21636. Related to #20987. A markdown template without metadata should not be treated as an invalid template. And this PR fixed another bug that non-template files(neither .md nor .yaml) are treated as yaml files. <img width="504" alt="image" src="https://user-images.githubusercontent.com/9418365/198968668-40082fa1-4f25-4d3e-9b73-1dbf6d1a7521.png">
This commit is contained in:
@@ -170,7 +170,7 @@ func (it IssueTemplate) Type() IssueTemplateType {
|
||||
if ext := filepath.Ext(it.FileName); ext == ".md" {
|
||||
return IssueTemplateTypeMarkdown
|
||||
} else if ext == ".yaml" || ext == ".yml" {
|
||||
return "yaml"
|
||||
return IssueTemplateTypeYaml
|
||||
}
|
||||
return IssueTemplateTypeYaml
|
||||
return ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user