Closed
Description
Description
I was trying to replace the truncate
filter from twig/extensions
with the new u
filter, but it looks like u.truncate
doesn’t have a preserve
option, is there a way to achieve the same thing? If not, I could add the parameter to the truncate
method.
Example
With twig/extensions
:
{{ "Hello World!"|truncate(7, true) }} // Hello World!
With u
filter:
{{ "Hello World!"|u.truncate(7) }} // Hello W