[Catalyst] Catalyst::View::TT
Ivan Wills
ivanw at benon.com
Tue Nov 14 10:39:23 GMT 2006
Krzysztof Krzyżaniak wrote:
> Ivan Wills <ivanw at benon.com> writes:
>
>
>> Krzysztof Krzyżaniak wrote:
>>
>>> Ash Berlin <ash at cpan.org> writes:
>>>
>>>
>>>
>>>> Ivan Wills wrote:
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>> I'm using Catalyst::View::TT to display my pages. I'm having trouble
>>>>> removing excess blank lines appearing at the top of my files.
>>>>>
>>>>> I realise this is not normally a problem but I am playing with mixing
>>>>> SVG and XHTML (with content-type=text/xhtml) but Firefox considers the
>>>>> extra blank lines to be an error when in XML rendering mode if they
>>>>> appear before the <?xml ... ?> deceleration.
>>>>>
>>>>> Any one know how to remove those blank lines?
>>>>>
>>>>>
>>>> [% END -%]
>>>>
>>>> also known as RTFM ;)
>>>>
>>> or options of template toolkit
>>>
>>> PRE_CHOMP, POST_CHOMP
>>> Remove whitespace before/after directives (default: 0/0).
>>>
>>> eloy
>>>
>> The PRE_CHOMP option looks like the options that I want but where do I
>> apply those settings?
>>
>
> I use config file but it could be defined in View definition, for example
>
> package AppName::View::TT;
>
> use strict;
> use base 'Catalyst::View::TT';
>
> __PACKAGE__->config->{'PRE_CHOMP'} = 1;
>
> 1;
>
> eloy
>
I have added this line and it removes one blank line from the out put
unfortunately there were two lines so it is still causing problems. I
have checked my templates to make sure they don't have any leading white
space, which they don't (they currently are very simple 7 lines long).
So I can only assume that it is Catalyst that is adding the lines. Is it
possible that Catalyst::Response is adding the extra lines when
returning to the browser?
Ivan
More information about the Catalyst
mailing list