blob => join("\n", map $_->{line}, @$blame),
);
- $c->forward('Model::ContentMangler')
- unless $c->stash->{no_wrapper};
+ $c->forward('Model::ContentMangler');
};
=head2 blob
is_image => File::Type::WebImages::mime_type($c->stash->{blob}),
is_binary => Gitalist::Utils::is_binary($c->stash->{blob}),
);
-
- $c->forward('Model::ContentMangler')
- unless $c->stash->{no_wrapper};
+ $c->forward('Model::ContentMangler');
};
after history => sub {
my @steps = $self->resolve({ filename => $c->stash->{filename} });
my @css = map { $_->[1]->{css} } grep { exists $_->[1] && exists $_->[1]->{css} && defined $_->[1]->{css} && length $_->[1]->{css} } @steps;
- $c->stash(syntax_css => [ map { $c->uri_for('/static/css/syntax/' . $_ . '.css') } @css ]);
+ $c->stash(
+ syntax_css => [ map { $c->uri_for('/static/css/syntax/' . $_ . '.css') } @css ],
+ mangled => scalar @steps,
+ );
if ($c->stash->{blobs} || $c->stash->{blob}) {
foreach my $step (@steps) {
[%- ELSIF is_binary -%]
<div class='blob'>This is a binary file which won't render natively on the web, but you can get it here all the same: <a href="[% c.uri_for_action('/ref/raw', c.req.captures, filename) %]" title="[% filename %]">[% filename %]</a></div>
[%- ELSE -%]
-<pre class='blob'>[% blob | html %]</pre>
+[%- INCLUDE inc/syntax_highlight_css.tt2 -%]
+<pre class='blob'>[% IF mangled; blob; ELSE; blob | html; END; %]</pre>
[%- END -%]
-[% INCLUDE inc/syntax_highlight_css.tt2 %]
-
<h3>[% INCLUDE 'nav/path.tt2' %]</h3>
[% IF object.type == 'commit' %]