From: Todd Zullinger Date: Wed, 15 Apr 2009 15:40:12 GMT Subject: [PATCH] Use   instead of   for XHTML compliance Message-ID: <20090415154012.GX13966@inocybe.teonanacatl.org> From: Ricky Zhou --- This was noticed by the Fedora Infrastructure folks. The pages rendered fine in Firefox, but caused an XML error when run through tor and privoxy together. Part of this problem description may belong in the commit message -- I was hesitant to add it, as I didn't read all of the IRC log where the problem was noticed and debugged. gitweb/gitweb.perl | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 33ef190..55b56f7 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1042,8 +1042,8 @@ sub esc_html ($;%) { $str = to_utf8($str); $str = $cgi->escapeHTML($str); - if ($opts{'-nbsp'}) { - $str =~ s/ / /g; + if ($opts{'-subspaces'}) { + $str =~ s/ / /g; } $str =~ s|([[:cntrl:]])|(($1 ne "\t") ? quot_cec($1) : $1)|eg; return $str; @@ -1056,8 +1056,8 @@ sub esc_path { $str = to_utf8($str); $str = $cgi->escapeHTML($str); - if ($opts{'-nbsp'}) { - $str =~ s/ / /g; + if ($opts{'-subspaces'}) { + $str =~ s/ / /g; } $str =~ s|([[:cntrl:]])|quot_cec($1)|eg; return $str; @@ -1383,7 +1383,7 @@ sub file_type_long { sub format_log_line_html { my $line = shift; - $line = esc_html($line, -nbsp=>1); + $line = esc_html($line, -subspaces=>1); $line =~ s{\b([0-9a-fA-F]{8,40})\b}{ $cgi->a({-href => href(action=>"object", hash=>$1), -class => "text"}, $1); @@ -1710,7 +1710,7 @@ sub format_diff_line { -class=>"list"}, $to_text); } $line = "@@ $from_text $to_text @@" . - "" . esc_html($section, -nbsp=>1) . ""; + "" . esc_html($section, -subspaces=>1) . ""; return "
$line
\n"; } elsif ($from && $to && $line =~ m/^\@{3}/) { my ($prefix, $ranges, $section) = $line =~ m/^(\@+) (.*?) \@+(.*)$/; @@ -1743,10 +1743,10 @@ sub format_diff_line { $line .= $to_text; } $line .= " $prefix" . - "" . esc_html($section, -nbsp=>1) . ""; + "" . esc_html($section, -subspaces=>1) . ""; return "
$line
\n"; } - return "
" . esc_html($line, -nbsp=>1) . "
\n"; + return "
" . esc_html($line, -subspaces=>1) . "
\n"; } # Generates undef or something like "_snapshot_" or "snapshot (_tbz2_ _zip_)", @@ -2101,9 +2101,9 @@ sub git_populate_project_tagcloud { # Pad the title with spaces so that the cloud looks # less crammed. my $title = $ctags_lc{$_}->{topname}; - $title =~ s/ / /g; - $title =~ s/^/ /g; - $title =~ s/$/ /g; + $title =~ s/ / /g; + $title =~ s/^/ /g; + $title =~ s/$/ /g; $cloud->add($title, $home_link."?by_tag=".$_, $ctags_lc{$_}->{count}); } } else { @@ -3535,7 +3535,7 @@ sub git_difftree_body { -title => 'commitdiff to parent number ' . ($i+1) . ': ' . substr($par,0,7)}, $i+1) . - " \n"; + " \n"; } print "\n\n"; } @@ -4275,7 +4275,7 @@ sub git_tags_body { if ($tag{'type'} eq "tag") { print $cgi->a({-href => href(action=>"tag", hash=>$tag{'id'})}, "tag"); } else { - print " "; + print " "; } print "\n" . "" . " | " . @@ -4491,7 +4491,7 @@ sub git_summary { git_header_html(); git_print_page_nav('summary','', $head); - print "
 
\n"; + print "
 
\n"; print "\n" . "\n" . "\n"; @@ -4602,7 +4602,7 @@ sub git_tag { my $comment = $tag{'comment'}; foreach my $line (@$comment) { chomp $line; - print esc_html($line, -nbsp=>1) . "
\n"; + print esc_html($line, -subspaces=>1) . "
\n"; } print "\n"; git_footer_html(); @@ -4888,7 +4888,7 @@ sub git_blob { $nr++; $line = untabify($line); printf "
%4i %s
\n", - $nr, $nr, $nr, esc_html($line, -nbsp=>1); + $nr, $nr, $nr, esc_html($line, -subspaces=>1); } } close $fd @@ -5913,13 +5913,13 @@ sub git_search { } else { $ltext = untabify($ltext); if ($ltext =~ m/^(.*)($search_regexp)(.*)$/i) { - $ltext = esc_html($1, -nbsp=>1); + $ltext = esc_html($1, -subspaces=>1); $ltext .= ''; - $ltext .= esc_html($2, -nbsp=>1); + $ltext .= esc_html($2, -subspaces=>1); $ltext .= ''; - $ltext .= esc_html($3, -nbsp=>1); + $ltext .= esc_html($3, -subspaces=>1); } else { - $ltext = esc_html($ltext, -nbsp=>1); + $ltext = esc_html($ltext, -subspaces=>1); } print "
" . $cgi->a({-href => href(action=>"blob", hash=>$co{'hash'}, -- 1.6.0.6 -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To have a successful relationship, I must learn to make it look like I'm giving as much as I'm getting.
description" . esc_html($descr) . "
owner" . esc_html($owner) . "