LineBreaks method (text)

Replaces line breaks in this text with appropriate HTML.

Syntax

text.LineBreaks

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

A single new line becomes a line break (<br>) and a new line followed by one or more blank lines becomes a paragraph break (<p>).

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.LineBreaks }}
{{ text2.LineBreaks }}

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