You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Christoph Reck <ap...@recks.org> on 2005/06/02 09:21:51 UTC

Re: poroblem with linefeed in velocity templates

<grinn/>
this is a case where my StructuredWhitespaceGobbling proposal would
do the right_thing(tm). THis is an example where it minimally breaks BC.

;) Christoph Reck


Shinobu Kawai wrote:
> Hi Mike,
> 
> 
>>But now after changes to
>>
>>textfield_one:    #if($ref_variable_one != "") $ref_variable_one #end
>>textfield_two:    #if($ref_variable_two != "") $ref_variable_two #end
>>
>>textfield_three:  #if($ref_variable_three != "") $ref_variable_three
>>#end
>>textfield_four:    #if($ref_variable_four != "") $ref_variable_four #end
>>
>>it will be render to:
>>
>>textfield_one:    one textfield_two:    two
>>textfield_three:  three textfield_four:    four
>>
>>Did anyone know a solution for this problem?
> 
> 
> Another case of VelocityWhitespaceGobbling.
>   http://jakarta.apache.org/velocity/user-guide.html#VTL:%20Formatting%20Issues
>   http://wiki.apache.org/jakarta-velocity/VelocityWhitespaceGobbling
> 
> One thing you can do, is add a line feed before the #end.
> 
> textfield_one:    #if($ref_variable_one != "") $ref_variable_one
> #end
> textfield_two:    #if($ref_variable_two != "") $ref_variable_two
> #end
> 
> textfield_three:  #if($ref_variable_three != "") $ref_variable_three
> #end
> textfield_four:    #if($ref_variable_four != "") $ref_variable_four
> #end
> 
> Best regards,
> -- Shinobu
> 
> --
> Shinobu Kawai <sh...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

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