I have a model named news,news have a field named description,I use a RichTextArea to get the value of desc开发者_高级运维ription from user,so user can enter html tags into this field,now I show the value of description in my template like this:
<div>
<h1>{{news.Title}}</h1>
{{news.Description}}
</div>
imagine that description field contain this text:
this is a test!
- item1
- item2
- item3
template show the value of description in the same way that is saved,I mean it shows tags in the template output not a formatted HTML! what should I do?
You need the safe
filter:
{{news.Description|safe}}
精彩评论