django_markdown icon indicating copy to clipboard operation
django_markdown copied to clipboard

Preview is showing correctly, but the django is rendering plain text instead of markdown formatted

Open jeffwillette opened this issue 9 years ago • 3 comments

I am using 1.9 and I cannot get the formatted mardown text to show in my template, but it works correctly in the preview. I have followed all the instructions. Is this a 1.9 bug?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/30439782-preview-is-showing-correctly-but-the-django-is-rendering-plain-text-instead-of-markdown-formatted?utm_campaign=plugin&utm_content=tracker%2F332251&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F332251&utm_medium=issues&utm_source=github).

jeffwillette avatar Feb 02 '16 07:02 jeffwillette

I think you need this at the top of your template page if you don't have it already: {% load django_markdown %} It worked for me (though using django 1.8)

bradcrotty avatar Apr 17 '16 17:04 bradcrotty

I met the same problem today, and I load

{% load django_markdown %}

at the top of my template.

zhaochy1990 avatar May 22 '16 14:05 zhaochy1990

I met the same problem, though {% load django_markdown %} did not solve the issue. I am working with Django 1.9 & django_markdown 2.6.8. Preview is working in the admin section (I had to modify the views.py to get it working), I just get plain text when the page is shown.

Here is my template:

{% extends 'blog/base.html' %}
{% load django_markdown %}

{% block content %}
<div>
    <h1><a href="{% url 'section_detail' pk=section.pk %}">{{ section.title }}</a></h1>
    <p>{{ section.text | safe | linebreaksbr }}</p>
</div>
{% endblock %}

Any clue appreciated.

marcjoos-phd avatar Jun 25 '17 09:06 marcjoos-phd