Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can velocity ignore newlines and whitespaces?

I want to put newlines and whitespaces in my velocity template to make it more readable. But my output must conform to a format that does not accept newlines and whitespaces.

Can velocity be configured to ignore whitespaces?

like image 738
flybywire Avatar asked Nov 12 '22 05:11

flybywire


1 Answers

By default no, but it is possible to do it if you're in control of how the templates are rendered. You can check how XWiki does this: it uses a configurable filter to pre-process the Velocity code to remove white space, and perhaps the indent filter is the one that suits your needs.

like image 165
Sergiu Dumitriu Avatar answered Nov 15 '22 10:11

Sergiu Dumitriu