I'm storing some HTML in my sqlite database. I'm trying to render this in a web page. However, it renders the tags in the page and I don't want this to be the case.
views.py:
textBody = textBody.query.filter_by(id=TextId).first()
data = {
'textToBeRendered': textBody.htmlTextBody
}
return render('home.html', data = data)
home.html:
<div class = "content">
<p id = "textBody" class = "formatted-text">
{{ data.textToBeRender }}
</p>
</div>
text to be rendered is:
<div>
Hello there, this is <b> Important </b>. Don't forget your appointment at 12pm today.
<u> Address </u> <br/>
123 Street <br/>
city<br/>
code
<br/><br/>
<u> Notes </u> <br/>
<span class = "important">Don't forget to bring the presentation with you! </span>
<br>
</div>
At the moment when I pull this information through into home.html it renders the raw text and I actually want it to render the html tags.
Any ideas?
Thank you.