Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: allow line break from textarea input

Tags:

html

django

How do I allow line breaking in textarea input in django to later show this input on page?

like image 514
barin Avatar asked Dec 12 '09 22:12

barin


1 Answers

linebreaks

Replaces line breaks in plain text with appropriate HTML; a single newline becomes an HTML line break (<br />) and a new line followed by a blank line becomes a paragraph break (</p>).

For example:

{{ value|linebreaks }}

If value is Joel\nis a slug, the output will be <p>Joel<br />is a slug</p>.

like image 149
barin Avatar answered Sep 20 '22 21:09

barin