Tutorials References Exercises Bootcamp Menu
Sign Up Create Website Get Certified Pro

Template Filter - linebreaksbr


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.


{{ value|linebreaksbr }}

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