SV: SV: [ZPT] mangled source

Guido van Rossum guido@digicool.com
Mon, 25 Jun 2001 10:29:44 -0400


> > Normally it tries to align like so:
> > 
> >       <td foo="bar"
> >           "bar="foo">
> > 
> > but when the start of the tag is indented very far, it reduces the
> > indent to 4 spaces instead:
> > 
> >                            <td foo="bar"
> >     "bar="foo">
> > 
> > Otherwise the wrapping feature would not be much use.
> 
> Imho it should do it like;
> 
>                              <td foo="bar"
>                                  "bar="foo">
> 
> Alignment becase of screen width or something should be done by the editor,
> like emacs or dreamweaver.

That's why you can disable the feature (with wrap=0).  You can also
customize it (e.g. wrap=80 only wraps lines longer than 80 chars;
default is 60 to accommodate the ZMI edit form).

> To be able to write something like:
> 
> <td tal:condition="not:here/foo" tal:attributes="bgcolor
> python:here.bar(color=3)" tal:content="string:foobar">
> 
> and end up with:
> 
> <td tal:condition="not:here/foo" 
>     tal:attributes="bgcolor python:here.bar(color=3)" 
>     tal:content="string:foobar">
> 
> is what I would like to have....

It does this now, more or less (it tries to put multiple attributes on
the same line if they fit according to the wrap value).

> and it should not matter if it was;
> 
>                               <td tal:condition="not:here/foo" 
>                                   tal:attributes="bgcolor
> python:here.bar(color=3)" 
>                                   tal:content="string:foobar">
> 
> /Magnus

Indeed it can output that too.  But it will never remove significant
spaces like the ones before "<td".

--Guido van Rossum (home page: http://www.python.org/~guido/)