Preserving an HTML/non-HTML version of a WMD textarea in Django?
Question
I setup the default wmd.js
to my admin textareas for my Bug models. Now it gets saved as HTML and when I go to edit the entry in the admin, I see the literal HTML:
<p>foo</p>
What strategy could I use so it only renders this <p>foo</p>
in the views/HTML instead of the edit view?
Solution 2
It seems I had to make the Markdown save as "Markdown" type, and use the markdown
Django module to keep a second column of my textarea (the pure one).
OTHER TIPS
You need to mark the output as safe so it doesn't get autoescaped. See the autoescaping docs.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow