'Display text from CKEditor from SQLalchemy in HTML
I used CKEditor in flask form and saved the data using SQLAlchemy and when I try to display the text with HTML using Jinja2. It doesn't display as entered.
Here is the code (it is suppose to be a in text format but instead looks like a source code):
<p>Emailed <strong>user first strike,</strong> <a href="http://www.google.co.in">awaiting user's reply</a>.</p>
<p>Emailed user second strike, awaiting user's reply.</p><p><strong>Emailed user-third strike, will be closing the case by the end of tomorrow's working hours.</strong></p>
Here is the expected result:
Emailed user first strike, awaiting user's reply.
Emailed user second strike, awaiting user's reply.
Emailed user-third strike, will be closing the case by the end of tomorrow's working hours.
Solution 1:[1]
Add |safe in the html to render the text as it is in html.
example:
{{ column.description|safe }}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | thefox |
