开发者

Preserving an HTML/non-HTML version of a WMD textarea in Django?

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?


You need to mark the output as safe so it doesn't get autoescaped. See the autoescaping docs.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜