How can I trim whitespace by Velocity
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a method called render_something which can creates a lot of whitespace, for example: <a href = "#" > #render_something('xxx') </a> The result can be: <a href = "#" > something that generate from redner_something </a> Which actually I want it to be like this: <a href = "#" > something that generate from redner_something </a> Does velocity has something like this? #trim(#render_something('xxx')) 回答1: I just read this article on Velocity Whitespace Gobbling which suggests a few work-arounds including Velocity Whitespace