I have text saved in a database record that looks like this.
This is the text
This is on a new line with a space in between
When I output it on the Django template, it comes out like this
This is the text This is on a new line with a space in between
How can I output the text on my django template to reflect the way it appears in the database?
Use linebreaks
or linebreaksbr
filter:
{{ text|linebreaks }}
Or surround the text with <pre>...</pre>
.
<pre>{{ text }}</pre>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With