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

ucfirst doesn't work with capitalized string #267

Open
csimpi opened this issue Apr 23, 2019 · 1 comment
Open

ucfirst doesn't work with capitalized string #267

csimpi opened this issue Apr 23, 2019 · 1 comment

Comments

@csimpi
Copy link

csimpi commented Apr 23, 2019

Hi, thank you for this awesome plugin!

I just noticed ucfirst filter doesn't work with fully capitalized string.

Expected behavior:
hello leo => Hello Leo
HELLO LEO => Hello Leo

Current behavior:
hello leo => Hello Leo
HELLO LEO => HELLO LEO

@bjarnef
Copy link

bjarnef commented Jul 4, 2019

I think the ucfirst only capitalize first character in each string and return the rest as it is.

return ch.charAt(0).toUpperCase() + ch.substring(1);

<p> {{ 'foo bar baz' | ucfirst }}</p>

<!--
result:
Foo Bar Baz
-->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants