velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph.R...@dlr.de
Subject Re: Formatting Issue (Whitespace)
Date Wed, 27 Nov 2002 10:00:41 GMT
To my knowledge the current whitespace handling has some
more quirks to what you state, more below...

Hiroaki Nakamura wrote:
> Well, I don't think this is a problem, IMO.
> 
> The rule is simple:
> - Directives begins with # and ends with the line separator (\n)
AFAIKS:
* whitespaces after an #if(...) go through
* a #set(...) directive also gobbles leading whitespaces

I haven't re-checked this, so I might be wrong...

> - Everything except directives and references are raw texts (including line separators).
> 
> Yes, I agree that it is not easy to read templates without indentations of directives.
> However, if Velocity must recognize indentations of directives, it will be much harder
to implement the parser.
> And with the implementation, it will be confusing when you must have extra spaces. For
example,
> -----------------------------------------------------------
> #foreach($item in $list)
>   #if($someCondition)
>     some text and new line and two spaces.
>     #end
> #end
> -----------------------------------------------------------
> Note two extra spaces before #end of #if.
> 
> So, I think that the current treating of whitespaces are OK.
> 
> Just my 2 yen :-)
[snip]

-- 
:) Christoph Reck


--
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