From: Tomas Doran Date: Tue, 12 Jan 2010 02:12:27 +0000 (+0000) Subject: Turn the syntax highlighter into a standard view with a render method X-Git-Tag: 0.002002~36 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1b72203cbe7740d3f7d385b6d446119528740742;p=catagits%2FGitalist.git Turn the syntax highlighter into a standard view with a render method --- diff --git a/lib/Gitalist/View/SyntaxHighlight.pm b/lib/Gitalist/View/SyntaxHighlight.pm index 2df82ed..2f77e44 100644 --- a/lib/Gitalist/View/SyntaxHighlight.pm +++ b/lib/Gitalist/View/SyntaxHighlight.pm @@ -31,15 +31,16 @@ sub process { my($self, $c) = @_; for($c->stash->{blobs} ? @{$c->stash->{blobs}} : $c->stash->{blob}) { - $_ = $self->highlight($c->stash->{language} => $_); + $_ = $self->render($c, $_, { language => $c->stash->{language} }); } $c->forward('View::Default'); } -# XXX This takes for freakin' ever on big merges. A cache may be needed. -sub highlight { - my($self, $lang, $blob) = @_; +sub render { + my ($self, $c, $blob, $args) = @_; + + my $lang = $args->{language}; my $ret; if($lang) {