- I am collecting user input and storing them in database with html tags to retain the formatting.
- for example: an response coming from database could be
asdsad <br/>- 12321312<br/>- 332423<br/>* e23ee<br/>$ dweqw
- Usually I care only about line breaks
- While reading this response from django-template, I do
<div id="right_suggest_div" name={{ suggestion.key }}> {{ suggestion.text }} <p class="padding">Votes: {{ suggestion.votes }} </p> </div>
Question:
– Is it possible to render suggestion.text as html?
By default Django will replace symbols like “>” and “<” with HTML entities.
I imagine that making it skip escaping the HTML would remedy the situation.
or use the
safefilter{{ suggestion.text|safe }}