velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Denis <j...@respublica.fr>
Subject Re: Quick Question.
Date Mon, 09 Sep 2002 13:03:33 GMT

On Monday, September 9, 2002, at 08:07  am, Carsten Burstedde wrote:

>> For those of us who use Velocity to generate something other than HTML
>> code, the suggestion to ignore leading whitespace before a directive
>> breaks our templates.  I have velocity templates that have 
>> leading spaces
>> before the directives, and I want those spaces to remain.

If Velocity implements a different whitespace handling, it will 
break templates where whitespace is important. The tradeoff is that 
it will be easier to handle whitespace once it is implemented. I 
think it is well worth it, but I would like to hear your real-world 
experience.

>
> But even if you are doing plain text processing, indented velocity 
> code will produce lots of whitespace that you do not want.
>
> What about allowing
> #if bla
> #  set goo
> #end

Good suggestion, but at the moment "#   directive" is output as is, 
and changing this may break HTML/XML templates even if they don't 
care about whitespace.

> and ignoring all whitespace on a line if and only if there is only 
> whitespace from the last velocity token till the end of line?

As Barbara mentioned, that will cause problems if you /need/ the 
leading whitespace before your directives.
Maybe we could gobble leading whitespace on lines that finish with 
a ##? (currently Velocity gobbles everything from ## up to, and 
including the end-of-line character)

Cheers,

-- Denis.

>
> Carsten
>


--
To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


Mime
View raw message