Hi,
Let me just add that I think this is a bug in TT.
According to my previous example:
[% SET a = "
adsf
adsf
"
%]
Which represents the string
"\nadsf\nadsf\n"
is compiled to
"\n adsf\n \n "
which is clearly not what the intention of the programmer was.
- Fagzal
> Hi,
>
>> [SNIP]
>>> I have just tried this (similar problem):
>>>
>>> [% SET a = "
>>> adsf
>>> adsf
>>> "
>>> %]
>>>
>>> Gives me:
>>>
>>> $stash->set('a', '
>>> adsf
>>> adsf
>>> ');
>>> $output .= "\n\n";
>>>
>>> Once again the whitespaces...
>>
>>
>> Try:
>> [% a = 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 => $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 = '$output .= ';
>
> But I don't really know how TT works, so I cannot find what
> "concatenates" these individual $OUTPUT lines :(
>
> - Fagzal
>
>
>
> _______________________________________________
> templates mailing list
> [email protected]
> http://lists.template-toolkit.org/mailman/listinfo/templates
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates