There is also a simple help function that can be called that will format and edit the text, correctly replacing \ n for tags (see http://sluggo.scrapping.cc/python/WebHelpers/modules/html/converters.html ).
In helpers.py add the following:
from webhelpers.html.converters import textilize
Then in your mako file just say
h.textilize( c.info['about_me'], santize=True)
Santize = True means that it will make sure that any other nasty codes will be escaped so that users cannot hack your site, since the default is False. As an alternative, I make a simple wrapper function in helpers, so santize = True is always True ie
from webhelpers.html.converters import textilize as unsafe_textilize def textilize( value, santize=True): return unsafe_textilize( value, santize )
So you can just call h.textilize (c.info ['about_me']) from your mako file, which if you work with a lot of designers will prevent them from going crazy.
source share