velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: Removed linebreak after macro calling
Date Tue, 16 Dec 2008 15:42:49 GMT
Can't you insert the extra line in the macro body itself?  If not, you
can always do something like:

context.put("n", "\n");

and then

#getProperty('name')$n

or if you are using VelocityTools, the EscapeTool has a getN() method:

#getProperty('name')$esc.n

On Tue, Dec 16, 2008 at 4:44 AM, Matthias Keller
<matthias.keller@ergon.ch> wrote:
> Hi
>
> I've defined a macro purely for convenience to avoid long method calls
> inside my template. It looks like this:
>
> #getProperty('name')
> #getProperty('function')
> #getProperty('department')
>
> Since this is plaintext (not html), whitespaces do matter, but the result is
> like this:
>
> namefunctiondepartment
>
> instead of
>
> name
> function
> department
>
> To fix this I have to insert an extra empty line between every call.... is
> there another way to do that? It looks really awful in the template to have
> so many empty lines
>
> Thanks
>
> Matt
>
> --
> matthias.keller@ergon.ch  +41 44 268 83 98
> Ergon Informatik AG, Kleinstrasse 15, CH-8008 Z├╝rich
> http://www.ergon.ch
> ______________________________________________________________
> e r g o n    smart people - smart software
>
>
>

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


Mime
View raw message