# [Default: highlight]
our $highlight_bin = "highlight";
-our $highlight_force = 0;
-
# information about snapshot formats that gitweb is capable of serving
our %known_snapshot_formats = (
# name => {
# or return original FD if no highlighting
sub run_highlighter {
my ($fd, $highlight, $syntax) = @_;
- return $fd unless ($highlight && (defined $syntax || $highlight_force));
+ return $fd unless ($highlight);
close $fd;
- my $syntax_arg = "--syntax $syntax";
- if ($highlight_force) {
- $syntax_arg = "--force"
+ my $syntax_arg = "--force";
+ if ($syntax) {
+ $syntax_arg = "--syntax $syntax";
}
open $fd, quote_command(git_cmd(), "cat-file", "blob", $hash)." | ".
quote_command($^X, '-CO', '-MEncode=decode,FB_DEFAULT', '-pse',
$line = untabify($line);
printf qq!<div class="pre"><a id="l%i" href="%s#l%i" class="linenr">%4i</a> %s</div>\n!,
$nr, esc_attr(href(-replay => 1)), $nr, $nr,
- ($syntax || $highlight_force) ? sanitize($line) : esc_html($line, -nbsp=>1);
+ ($highlight) ? sanitize($line) : esc_html($line, -nbsp=>1);
}
}
close $fd