I am working on a django project with a model like:
class Article(models.Model):
...
# which is submitted by users through a markdown editor.
content = models.TextField(_('content'), blank=True)
...
As a result, I render the content in the templates with Jinja2, what I get is only raw markdown content without any style.
Not sure about Django, but I use Markdown with Jinja2 in flask. I initialize Markdown when the app runs like this.
from flask.ext.markdown import Markdown
md = Markdown(app, extensions=['fenced_code'])
Then I add the filter to the template.
<H2>{{ post.title }}</H2>
{{post.body|markdown}}
In short, do you have the template filter set?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With