TIP: easiest way to truncate some text using handlebars
1
{{ellipsis "<span>foo bar bar bar</span>" 7}}
results in
"foo bar..."
Or when you need to be sure some item text value is not too big, like news summary spfx webpart:
1
2
3
4
5
6
7
8
9
10
11
{{#gt Item.textValue.length 50}}
{{ellipsis Item.textValue 50}}
<button>Read more</button>
{{else}}
{{Item.textValue }}
{{/gt}}