[Twisted-web] Problems with the new lines

Alberto Trujillo alberto.trujillo at ucd.ie
Wed Aug 31 05:36:52 MDT 2005


Valentino Volonghi aka Dialtone wrote:

>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.
>
>  
>
Hi again Valentino. I've tried the method that you told me ...

description = data.description.replace('\n', '<br />')
ctx.fillSlots('description', description)

but now what I see is the next result:

line one<br />line 2

What's wrong?



More information about the Twisted-web mailing list