LineBreaksBrOnly method (text)

Replaces line breaks in this text with HTML line breaks.

Syntax

text.LineBreaksBrOnly

Returns the value of text with <br> in the place of line breaks.

The text will be auto-escaped if required, and the returned text flagged as safe.

Example

{% Var text1 = "The price of apples is:\n£2.00" %}
{% Var text2 = "Dear John,\n\nThank you for your order." %}

{{ text1.LineBreaksBrOnly }}
{{ text2.LineBreaksBrOnly }}

The above example would output:
The price of apples is:<br>&#163;2.00
Dear John,<br><br>Thank you for your order.