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

Closed
jmooring opened this issue Sep 4, 2024 · 2 comments
Closed

tpl/inflect: Humanize runtime error #12827

jmooring opened this issue Sep 4, 2024 · 2 comments

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

This was fixed in gobuffalo/flect v1.0.3.

@bep bep added this to the Unscheduled milestone Sep 4, 2024
khayyamsaleem added a commit to khayyamsaleem/hugo that referenced this issue Sep 21, 2024
khayyamsaleem added a commit to khayyamsaleem/hugo that referenced this issue Sep 21, 2024
@bep bep closed this as completed in 1e690c0 Sep 21, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants