Gaurav Rathi
Gaurav Rathi

Reputation: 93

What is the difference between [% %] and [%- -%] in Template Toolkit?

What is the difference between [% %] and [%- -%] in Template Toolkit?

Upvotes: 5

Views: 1487

Answers (1)

ysth
ysth

Reputation: 98398

The - automatically removes some whitespace from before/after the directive tag.

See Template::Manual::Syntax:

You can add - or + to the immediate start or end of a directive tag to control the whitespace chomping options. See the PRE_CHOMP and POST_CHOMP options for further details.

See Template::Manual::Config for good examples of the effects with and without pre and post chomping.

Upvotes: 10

Related Questions