java - How can I trim whitespace by Velocity -


i have method called render_something can creates lot of whitespace, example:

<a href="#">#render_something('xxx')</a> 

the result can be:

<a href="#">                  generate redner_something                 </a>  

which want this:

<a href="#">something generate redner_something</a> 

does velocity has this?

#trim(#render_something('xxx')) 

i read article on velocity whitespace gobbling suggests few work-arounds including velocity whitespace truncated line comment.

this suggests commenting out line breaks putting comments @ end of each line. suggests not indenting code in macros prevent superfluous (one of favourite words) spaces occurring.

tbh it's not great solution may suit needs. put ## @ end of each line in macro , make things little bit nicer... sort of


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -