Closed tjaynl closed 8 months ago
The code {{ "Hello" |> truncate(2) }}
is compiled as "Hello"?.truncate?.(2)
, which returns undefined
.
Maybe it should be compiled to "Hello"?.truncate(2)
so it would output an error... 🤔
truncate
function doesn't exist (unless it's register as a filter). You can use substring for that:
{{ content |> md |> substring(0, 20) }}
Thank you for giving me an alternative, didn't know that could be used.
So i'm trying to truncate a portion of a text.
I tried this:
{{ content |> md |> truncate(20) }}
While this line does seem to work the output is not giving as in there is no content output but also no error. Am i doing it wrong?