diff options
author | Jason Song <i@wolfogre.com> | 2022-10-31 23:10:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-31 17:10:33 +0200 |
commit | 4ae3f762177a2cdb449b949501420e88462f8f95 (patch) | |
tree | 771b1c12ca241e00edfe651f5f8a157696293494 /modules/structs | |
parent | 9b3e2c54502ef8295ae18b5496588f0370138ef7 (diff) | |
download | gitea-4ae3f762177a2cdb449b949501420e88462f8f95.tar.gz gitea-4ae3f762177a2cdb449b949501420e88462f8f95.zip |
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">
Diffstat (limited to 'modules/structs')
-rw-r--r-- | modules/structs/issue.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/structs/issue.go b/modules/structs/issue.go index 27ec81f728..70f5e1ba8e 100644 --- a/modules/structs/issue.go +++ b/modules/structs/issue.go @@ -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 "" } |