labels
labels copied to clipboard
Mark function doesn't work when capitalize filter is applied
Left using capitalize, right not using capitalize
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