I'm trying to set up a Django app that has a MarkupField in it's model, like this:
from django.db import models
from markupfield.fields import MarkupField
class Recipe(models.Model):
instructions = MarkupField(default_markup_type='markdown')
Then I render the field in a Jinja2 template, like this:
{% if recipe.instructions %}
{{ recipe.instructions }}
{% else %}
No instructions have been added yet.
{% endif %}
Rendering of the markdowned text works flawless, but it is placed as a string inside the DOM so the browser doesn't interpret the HTML tags, like you can see here:
I don't feel like I missed something relevant in the django-markupfield's docs, but somehow I need to get rid of this string representation.
Anyone of you guys got an idea? Thanks in advance.


safefilter does it works:{{ recipe.instructions|safe }}?recipe.instructions.rendereddoes it make any change?{% autoescape off %}{{ recipe.instructions }}{% endautoescape %}like suggested in this question. Find it to be a bit inconvenient though...