I have the following Paragraph template which displays a heading with a trailing orange dot. The field itself is a normal text field in Drupal. For some reason, there is a trailing space after the heading, which leads to a space between the heading and the dot. I want to remove it (and |trim is the answer), but when I add trim to the below variable I get a PHP warning saying parameter 1 should be a string, not an array.
How do I then get the absolute value of the paragraph value?
{% block paragraph %}
<div{{ attributes.addClass(classes) }}>
{% block content %}
<h1>{{ content.field_heading_h1 }}<i class="orange">.</i></h1>
{% endblock %}
</div>
{% endblock paragraph %}
The following gives the PHP error:
{% block paragraph %}
<div{{ attributes.addClass(classes) }}>
{% block content %}
<h1>{{ content.field_heading_h1|trim }}<i class="orange">.</i></h1>
{% endblock %}
</div>
{% endblock paragraph %}
Warning: trim() expects parameter 1 to be string, array given in twig_trim_filter()