mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 15:21:27 +00:00
parent
d9bc233f1f
commit
adf405496e
2 changed files with 8 additions and 0 deletions
|
@ -1703,6 +1703,11 @@ func humanize(in interface{}) (string, error) {
|
|||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if word == "" {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
return inflect.Humanize(word), nil
|
||||
}
|
||||
|
||||
|
|
|
@ -1805,8 +1805,11 @@ func TestInflect(t *testing.T) {
|
|||
expected string
|
||||
}{
|
||||
{humanize, "MyCamel", "My camel"},
|
||||
{humanize, "", ""},
|
||||
{pluralize, "cat", "cats"},
|
||||
{pluralize, "", ""},
|
||||
{singularize, "cats", "cat"},
|
||||
{singularize, "", ""},
|
||||
} {
|
||||
|
||||
result, err := this.inflectFunc(this.in)
|
||||
|
|
Loading…
Reference in a new issue