HTML not being rendered in a Flask blog that accepts Markdown

484 Views Asked by At

Using a simple blog engine written on Flask (https://github.com/dmaslov/flask-blog) that accepts markdown for writing posts.

Markdown should support HTML. For some reason, my HTML is not being recognized, and my tags are rendered literally as text.

In my application file, I have

from flaskext.markdown import Markdown
md = Markdown(app, safe_mode=False, output_format='html5')

Using the flask.markdown library https://pythonhosted.org/Flask-Markdown/ in my flask application.

This should allow me to use HTML along side markdown in my posts, but for some reason it is not.

1

There are 1 best solutions below

0
On

This engine escapes html tags. Unfortunately or luckily you may use only wysiwyg editor.

In post.py file

line 162

cgi.escape(post_data['body'], quote=True)

More info about escaping cgi.escape