output: Identify extension-less text types as text

See #3614
This commit is contained in:
Bjørn Erik Pedersen
2017-06-20 17:20:08 +02:00
parent 19f2e72913
commit c43b512b47
2 changed files with 47 additions and 1 deletions

View File

@@ -219,7 +219,12 @@ func (formats Formats) FromFilename(filename string) (f Format, found bool) {
}
if ext != "" {
return formats.GetBySuffix(ext)
f, found = formats.GetBySuffix(ext)
if !found && len(parts) == 2 {
// For extensionless output formats (e.g. Netlify's _redirects)
// we must fall back to using the extension as format lookup.
f, found = formats.GetByName(ext)
}
}
return
}