Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpl/inflect: Humanize runtime error #12827

Open
jmooring opened this issue Sep 4, 2024 · 1 comment
Open

tpl/inflect: Humanize runtime error #12827

jmooring opened this issue Sep 4, 2024 · 1 comment

Comments

@jmooring
Copy link
Member

jmooring commented Sep 4, 2024

The inflect.Humanize template function throws an error if the argument consists of whitespace only. For example, each of these throws an error:

{{ inflect.Humanize " " }}
{{ inflect.Humanize "\n" }}
{{ inflect.Humanize "\t" }}

error calling humanize: runtime error: index out of range [0] with length 0

For the record, I wish this function:

  1. Called flect.Humanize without doing other things to the string
  2. Did not perform flect.Ordinalize; this should be moved to a separate template function
@jmooring
Copy link
Member Author

jmooring commented Sep 4, 2024

Upstream:
gobuffalo/flect#74

@bep bep added this to the Unscheduled milestone Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants