flybywire
flybywire

Reputation: 273452

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?

Upvotes: 5

Views: 3973

Answers (1)

Sergiu Dumitriu
Sergiu Dumitriu

Reputation: 11601

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.

Upvotes: 1

Related Questions