User: sits
Date: 08/06/17 23:44:34
Modified: lib/Codestriker/Http HighlightLineFilter.pm
Log:
Handle situation where the file is not recognised by the highlight program.
In this situation, fallback to basic html encoding.
Index: HighlightLineFilter.pm
===================================================================
RCS file:
/cvsroot/codestriker/codestriker/lib/Codestriker/Http/HighlightLineFilter.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HighlightLineFilter.pm 18 Jun 2008 04:47:13 -0000 1.3
+++ HighlightLineFilter.pm 18 Jun 2008 06:44:34 -0000 1.4
@@ -51,6 +51,11 @@
push @args, '-t';
push @args, $self->{tabwidth};
Codestriker::execute_command($read_stdout_fh, undef, $self->{highlight},
@args);
+ if ($read_data eq "") {
+ # Assume this occurred because the filename was an unsupported type.
+ # Just return the text appropriately encoded for html output.
+ $read_data = HTML::Entities::encode($text);
+ }
# Delete the temp file.
unlink $input_filename;
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Codestriker-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/codestriker-commits