velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: Whitespace, redux
Date Mon, 15 Apr 2002 17:53:33 GMT
On 4/15/02 1:12 PM, "Daniel Dekany" <> wrote:

> On Monday, April 15, 2002 2:33 PM "Geir Magnusson Jr." <>
> writen:
> [snip]
>>> #output("off")
>>> #if ($option1)
>>>   #echo("hello")
>>> #else
>>>   #echo("goodbye")
>>> #end
>>> #output("on") ## restoring output
>> This is *damn* cute. :)  Further, I would bet that this could be done
>> completely outside of the Velocity core.  No, not "yet another wet-blanket
> [snip]
> For those of you who don't know:
> ***

You don't have to shout.  Believe it or not, many of us had an idea about
this stuff long before you showed up - we understand the problems and are

> However it does it in a really *useless* and *disturbing* way.

And some, I am *sure*, don't appreciate the tone.  There are plenty of
reasons why things were done - do you think we went out of our way to make
something that was BOTH useless AND disturbing?  I tend to specialize in the
disturbing, but the integration to get useless in there is quite difficult
to do in a seamless way.

> (Eg. it gobbles whitespace around #set but does not gobble whitespace around
> #if)
> ***
> Geir. Why don't you fix the current whitespace gobbling rules first? Why why
> why? Or if you don't want to then disable whitespace gobbling.

The problem is that

1) We don't want to break existing things
2) We don't want to jump into yet another problematic behavior.

The ideal solution is something where xformations are pluggable or
determined by designer.  Personally, I can't figure which is better.
Pluggable is nice and transparent, but now separate from the template.  In
hands of designer is, of course, not transparent.

> And what do I think about #output("off")...  IMO
> #output("off")/#output("on") can be a very useful directive but it does not
> solve the problem what whitespace gobbling should.

In my opinion, specific whitespace gobbling algorithms just to make HTML
authors happy isn't something that Velocity should do.  I certainly
understand the need, I certainly want to find a solution, but I am not going
to help break stuff or make things even more convoluted.  Velocity isn't
perfect, but I think we have a situation where there is no perfect solution
- but we will find the best that we can.  It may not be yours - it many not
be mine - but we'll find one.


Geir Magnusson Jr.                           
System and Software Consulting
My inner cowboy needs to yodel.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message