abw/Template2 — pull request #29 by dracos (2013-09-04 14:25:34+00:00)
Title: Remove indenting within compiled templates

If a template contains a multiline string, within for example a call to a Locale::gettext template function for translation, then the compiled version of the string written to the compiled template file will contain extra indent whitespace due to the regular expressions within the as_perl() function. For example, the template fragment:

```
[% loc("This is a
multiline string.") %]
```
will be written to the compiled file as something like (note indentation):

```
Template::Document->new({
...
BLOCK => sub {
...
eval { BLOCK: {
...
$output .= $stash->get(['loc', [ 'This is a
multiline string.' ]]);
```

This means that - once a compiled template is loaded in, after say a server restart - the translation stops working because the original string does not exactly match the translation string.

The indentation appears to be optional, and is only within compiled template files, so this commit simply removes it.