On Mon, 24 Sep 2001 [EMAIL PROTECTED] wrote:

> >might be generating text into a  block where trying to get cute with
> >newlines would ruin the whole layout.
> 
> I wasn't very clear. Sorry. What I was thinking was that the newlines
> would only get stripped on lines that consisted entirely of
> non-outputting HTML::Template control directives, like
> <TMPL_LOOP>,</TMPL_LOOP> and <TMPL_IF>,</TMPL_IF> and a newline
> character.

whoops - wouldn't do anything for the example you gave earlier where
there's a bunch of spaces (tabs?) prior to the directive on your indented
lines - still, point made.

> Were the behavior of HTML::Template to change to what I'm suggesting,
> it most likely wouldn't break anyone's templates, unless they relied
> on these control structures having newlines with them.

actually, I have relied on such behaviour being part of HTML::Template in
the past, and it would break those templates I had written...  Some XML
parsers can be quite picky about just how much space there is between
tags...  And when you don't control them, it's nice to know the rules that
gets applied when you're writing your template are constant and there are
no special cases to remember.

If it's really something you'd like to use as part of the module, I'd
suggest you subclass it, and override output to pass through HTML::Clean
or (if not for HTML) another cleaning engine, which, as Sam pointed out
would have the additional advantage of cleaning up wasted space / tags in
your output that wasn't generated by how you set up the template
directives...

 - jody biggs


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to