[Twisted-web] Problems with the new lines

Mary Gardiner mary-twisted at puzzling.org
Wed Aug 31 05:54:01 MDT 2005


On Wed, Aug 31, 2005, Alberto Trujillo wrote:
> but now what I see is the next result:
> 
> line one<br /> line 2

If you have a look at the source of the page you're downloading, you'll
probably see that what the web browser received was:
    line one&lt;br /&gt;line 2

That is, Nevow has escaped the HTML tag <br /> for you. This is the
default behaviour, to force it to not escape things, see this
http://divmod.org/users/wiki.twistd/nevow/moin.cgi/FrequentlyAskedQuestions#head-8d1353dfa7189fd6ee8d540737a44f1c3ba71dc6

Since Nevow is designed to produce XML from Python objects, you may find
that it's a better design to actually split up your string and use
tags.br where you want line breaks, rather than starting to use Nevow to
put tags in some places, but bypassing Nevow and inserting them directly
in other places.

-Mary



More information about the Twisted-web mailing list