Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

Template Filter - linebreaksbr


Example

Convert any line breaks into <br>:

{{ mytext|linebreaksbr }}
Run Example »

Definition and Usage

The linebreaksbr filter replaces line breaks with <br> elements.

The difference between this filter and the linebreaks filter is that this filter replaces double line breaks with two <br> elements, but the linebreaks filter replaces double line breaks with a <p> element.


Syntax

{{ value|linebreaksbr }}

Template filters are defined by using a pipe | character followed by the name of the filter.