Syntax higlighting improvements
[catagits/Gitalist.git] / lib / Gitalist / View / SyntaxHighlight.pm
index 9c28341..de745ab 100644 (file)
@@ -5,7 +5,6 @@ use namespace::autoclean;
 extends 'Catalyst::View';
 
 use Syntax::Highlight::Engine::Kate ();
-use Syntax::Highlight::Engine::Kate::Perl ();
 
 use HTML::Entities qw(encode_entities);
 
@@ -17,7 +16,10 @@ sub process {
 
 sub render {
     my ($self, $c, $blob, $args) = @_;
-    
+
+    # Don't bother with anything over 64kb, it'll be tragically slow.
+    return encode_entities $blob if length $blob > 65536;
+
     my $lang = $args->{language};
 
     my $ret;