mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Convert the rest to new page parser code paths
And remove some now unused code. See #5324
This commit is contained in:
@@ -49,18 +49,12 @@ func (ns *Namespace) Remarshal(format string, data interface{}) (string, error)
|
||||
return result.String(), nil
|
||||
}
|
||||
|
||||
func toFormatMark(format string) (rune, error) {
|
||||
// TODO(bep) the parser package needs a cleaning.
|
||||
switch format {
|
||||
case "yaml":
|
||||
return rune(parser.YAMLLead[0]), nil
|
||||
case "toml":
|
||||
return rune(parser.TOMLLead[0]), nil
|
||||
case "json":
|
||||
return rune(parser.JSONLead[0]), nil
|
||||
func toFormatMark(format string) (metadecoders.Format, error) {
|
||||
if f := metadecoders.FormatFromString(format); f != "" {
|
||||
return f, nil
|
||||
}
|
||||
|
||||
return 0, errors.New("failed to detect target data serialization format")
|
||||
return "", errors.New("failed to detect target data serialization format")
|
||||
}
|
||||
|
||||
func detectFormat(data string) (metadecoders.Format, error) {
|
||||
|
Reference in New Issue
Block a user