X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=filesystem%2Fusr%2Fshare%2Fgitweb%2Fgitweb.cgi;h=ea4250feb5dbd792854226163ac098dbac0076c9;hb=3f437c0f6c11356451d5d739875eee2d4603d7ca;hp=507108bf22c340d4aed012dcd2bb7c7bec67850f;hpb=cef466a1c6b827f3a789ebedb5db575fca2e450b;p=distro-setup diff --git a/filesystem/usr/share/gitweb/gitweb.cgi b/filesystem/usr/share/gitweb/gitweb.cgi index 507108b..ea4250f 100755 --- a/filesystem/usr/share/gitweb/gitweb.cgi +++ b/filesystem/usr/share/gitweb/gitweb.cgi @@ -198,8 +198,6 @@ our $prevent_xss = 0; # [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 => { @@ -3933,12 +3931,12 @@ sub guess_file_syntax { # 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', @@ -7122,7 +7120,7 @@ sub git_blob { $line = untabify($line); printf qq!
%4i %s
\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