Latte's nl2br and htmlentities

8 years ago

bafoed
Member | 6
+
0
-

Hello.
There is the following entry in the database:
Screenshot 1

I need to display it into the template.
I write:

<td>{$oUser->about}</td>

get: Screenshot 2

I write:

<td>{$oUser->about|nl2br}</td>

get: Screenshot 3

As can be seen in the screenshot, the text of the nl2br also is treated, which is not needed in this case. What can I do in this situation?

8 years ago

voda
Member | 562
+
+1
-

Hi, try

<td>{!$oUser->about|escape|nl2br}</td>

8 years ago

bafoed
Member | 6
+
0
-

Thank you, it works.