[Twisted-web] Problems with the new lines

Valentino Volonghi aka Dialtone dialtone at divmod.com
Wed Aug 31 04:54:57 MDT 2005

Alberto Trujillo wrote:

> Do you know if there is any function in nevow that do this
> automatically. I don't mind to implement one, for the new line, but
> I'll allways have this problem with the specials characters.

No there is none. You might want to use something like markdown (or
napalm for the partial python implementation of Markdown in my sandbox)
or ReST (you have to install docutils) or textile or one of the many others.

If you just need to substitute the \n with <br /> just run a replace

description.replace('\n', '<br />')
before filling the slot so that you don't actually the original that the
user inserted.

Valentino Volonghi aka Dialtone
Now Running MacOSX 10.4.1
Blog: http://vvolonghi.blogspot.com

More information about the Twisted-web mailing list