[ZPT] Re: [Zope] returning an HTML comment from ZPT

Chris Withers chrisw@nipltd.com
Thu, 23 May 2002 15:01:18 +0100


Hi Fred :-)

"Fred L. Drake, Jr." wrote:
> 
> What makes you think that?  Why would something *inside* a comment get
> expanded?  I'd be very surprised myself.

Well, comments are sent to browsers, so are their contents. For me, that makes them fair
game for interpolation.

Who knows? Maybe you want some debugging:

<!-- dammit, we got xxx again -->

...which you don't want to be visible for users?

> Is it simply that DTML does it differently, or do you think there's a
> functional problem with not expanding commented-out TAL/METAL
> constructs?  Should it not be possible to include comments about TAL
> constructs (with examples) in page templates?

Well, there's two things that I guess are getting mixed here?

HTML comments - which I think should be expanded

TAL/METAL comments - which shouldn't be expanded.

I usually do the latter as:

<tal:comment condition="">
This code stinks, I should fix it some time ;-)
</tal:comment>

cheers,

Chris