Open lenvanessen opened 6 years ago
Yeah, most string filters output strings, not twig objects. The hacky way to do this would be {{ l('reed our creed')|striptags|capitalize }}
, but then you loose the mark tags.
I don't think this will be "fixed" since this is really twig core code, and it's "working as designed"
It usually makes more sense to do text-transform: uppercase;
via CSS.
@xiaohutai That'll transform the whole string, right? So not the same as |capitalize, right?
Usually capitalizing a whole string is a stylistic choice, but capitalizing the first letter is an indication of the meaning, right?
@SahAssar You're right! I misinterpreted it.
There's a text-transform: capitalize
in CSS, but this one is different than the one in Twig: https://twig.symfony.com/doc/2.x/filters/capitalize.html
Left using capitalize, right not using capitalize![schermafbeelding 2017-08-29 om 15 01 30](https://user-images.githubusercontent.com/23024452/29822221-00fa98ee-8ccb-11e7-98c5-808053e85ee1.png)