Unfortunately I haven't found anything on the web with this specific problem.
I have a field (text, formatted, long) and a form with a textarea element that should save the entered text to this field.
Now I want to render it in my twig template. I access the value like this in my controller:
'text' => $node->field_text->value
And I render it in twig normally:
<p>{{ text }}</p>
But whenever I entered a new line by pressing enter in the textarea, it doesn't render the new line. The same thing in the CKEditor when I edit the node and look at the content, there's no new line.
I'm sure that there's a linebreak though, because when I dpm()
this value, it prints that.
I tried putting the value in a '#markup' => $text
render array, but it was the same. How can I render this new line?