Improvements:
- if you strip tags you should
|trim
to get rid of whitespace - trim on word boundary - see below
slice()
andsplit()
- Use ellipsis (
…
) rather than "..." |raw
the output
{% set text = content.field_header_intro|render|striptags|trim %}
{{ (text|length > 200 ? text|slice(0, 201)|split(' ')|slice(0, -1)|join(' ') ~ '…' : text)|raw }}</code>