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

Template Filter - linebreaks


Convert line breaks into <br>, and double line breaks into <p>:

{{ mytext|linebreaks }}
Run Example »

Definition and Usage

The linebreaks filter replaces line breaks with <br> and double line breaks with <p>.

See also the linebreaksbr filter.


{{ value|linebreaks }}

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