[Templates] getting rid of auto ident

Fagyal Csongor concept@conceptonline.hu
Sat, 18 Nov 2006 00:33:28 +0100 (CET)


Hi,

> [SNIP]
>> I have just tried this (similar problem):
>>
>> [% SET a =3D "
>> adsf
>> adsf
>> "
>> %]
>>
>> Gives me:
>>
>>     $stash->set('a', '
>>     adsf
>>     adsf
>>     ');
>>     $output .=3D  "\n\n";
>>
>> Once again the whitespaces...
>
>
> Try:
> [% a =3D BLOCK %]
> adsf
> adsf
>
> [% END %]
Well... I have found some workarounds, too, but I am looking for *the*
solution :)

> I'm not sure about shutting off auto-indent. Maybe you can
> modify/subclass the Template::Document::as_perl routine to help you out
> there? (I just glanced at the code, so that could be the wrong spot.)
Thanks for the pointer, but that's not it.

as_perl has:
    BLOCK =3D> $block,

So it's $block that contains the paddings.

I have found that Directive.pm contains all these lines for the different
directives:
...
return "$OUTPUT \$context->insert($file);";
...
return "$OUTPUT " . &text($class, $text) . ';';
...
etc...
...

Where $OUTPUT is:
$OUTPUT    =3D '$output .=3D ';

But I don't really know how TT works, so I cannot find what "concatenates=
"
these individual $OUTPUT lines :(

- Fagzal