[ZPT] mangled source

Guido van Rossum guido@digicool.com
Sat, 23 Jun 2001 17:10:03 -0400


> > > Is there some way to keep zpt from adding newlines where there
> > > were none before?
> > > 
> > > something like this:
> > >         <td tal:content="here/blah/blah">text</td>
> > > 
> > > ends up like:
> > >         <td 
> > >     tal:content="here/blah/blah">text</td>
> > > 
> > > after it's saved.
> > 
> > Ah, the wrapping feature.  We do this because the HTML/XML parsers
> > don't tell us where and what the whitespace in the source is.  To
> > turn it off, edit TAL/TALInterpreter.py and change "wrap=60" to
> > "wrap=0" in TALInterpreter.__init__()'s parameter list.  Then a
> > tag will always be on one line, no matter how long it is...
> 
> That makes sense, but why does parsing need to change the source
> when I simply save the template in Zope?  I can see the output
> changing on rendering, but why when it's saved?  Sure, you
> should parse the text for errors, but leave the original text as
> it was and add an error message.  Or does the text need to be
> parsed to be allowed to be saved?

It's supposed to be a feature that macros are (re-)expanded whenever
you edit.  But you can turn it off: uncheck the "Expand macros when
editing" checkbox on the right above the text edit box.

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