[Catalyst] Catalyst::View::TT

Bill Moseley moseley at hank.org
Tue Nov 14 14:04:37 GMT 2006


On Tue, Nov 14, 2006 at 08:39:23PM +1000, Ivan Wills wrote:
> 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?

I've never seen this line in the source:

    $c->res->body( "\n" . $c->res->body );

Try stuffing $c->res->body in a controller with a little content and
then see if catalyst is adding blank lines.   I suspect there's still
a template you are missing.

Or try this in your end:

        if ( $c->res->content_type =~ /xhtml+xml/ ) {
            my $body = $c->res->body;
            $body =~ s/^\s+//;
            $c->res->body( $body );
        }

Do all browsers accept application/xhtml+xml these days?  I thought I
remembered seeing something about setting the content type based on
HTTP_ACCEPT.

-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list