using safemarkdown in template

27 views
Skip to first unread message

Bill Seitz

unread,
Jul 30, 2012, 3:56:30 PM7/30/12
to we...@googlegroups.com
Here's what I've done:
* installed python-markdown in my environment
* included 'safemarkdown': utils.safemarkdown in my globals passed to render() in my app code
* called like $safemarkdown(note.description) in my template which is rendering a list of notes

Unfortunately when I view that page output, I get visible/escaped tags like <p> in the content.

What am I doing wrong?

Anand Chitipothu

unread,
Jul 30, 2012, 10:11:31 PM7/30/12
to we...@googlegroups.com
You should use $:safemarkdown(note.description)

$foo always escapes the value. $:foo renders it verbatim.

Anand

Michael Diamond

unread,
Jul 30, 2012, 4:47:31 PM7/30/12
to we...@googlegroups.com

You probably want to call $:safemarkdown(note.description) - note the colon after the $ - this outputs the result of the expression without escaping it (a second time).

Michael

Michael Diamond
dim...@gmail.com
www.DigitalGemstones.com

Bill Seitz

unread,
Jul 31, 2012, 5:22:35 PM7/31/12
to we...@googlegroups.com
That did the job, thanks!
Reply all
Reply to author
Forward
0 new messages