velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: How do I make velocity preserve new lines in the output
Date Sat, 12 Jul 2008 20:02:31 GMT
That's odd.  If i remember correctly, the only newlines gobbled should
be when a #set directive is on a line by itself or when any other
directive (#foreach, #end, etc) is both on a line by itself and has no
preceding whitespace.  So the example template you gave should have
plenty of new lines.

What version of Velocity are you using?  And are you doing any other
processing of the content?

On Fri, Jul 11, 2008 at 2:28 PM, Roshan Ail <RAil@coremetrics.com> wrote:
> Hi,
>
>
>
> I am using velocity to output a groovy script.
>
>
>
> My velocity template is something like this.
>
>
>
>
>
> #foreach $c in $a
>
>
>
> def ${c}function()
>
> {
>
>  ....
>
> }
>
>
>
> #end
>
>
>
>
>
> The output that gets generated puts everything into one line and groovy
> fails to evaluate it since it expects each function definition to start
> with a new line.
>
>
>
> Essentially this is how the output gets generated at present.
>
>
>
> def afunction() { ... }  def bfunction {...}
>
>
>
>
>
> Is there any way I can have velocity preserve my formatting when the
> output is generated ?
>
>
>
>
>
> Thanks,
>
>
>
>
>
>
>
> Roshan
>
>

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


Mime
View raw message