chiark / gitweb /
html fixups
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 27 Jun 2010 19:16:42 +0000 (20:16 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 27 Jun 2010 19:16:42 +0000 (20:16 +0100)
cgi

diff --git a/cgi b/cgi
index 09762a2eb428192e11233fc23ca56bf81834621a..dc3137c6be667b84455d885d31359c00d677a42d 100755 (executable)
--- a/cgi
+++ b/cgi
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict qw(vars);
-use CGI qw/:standard/;
+use CGI qw/:standard -no_xhtml/;
 
 sub fail ($) {
     print(header(-status=>500),
@@ -265,16 +265,16 @@ sub start_page ($) {
            if ($couldbe eq $current) {
                print "<b>$show</b>";
            } else {
-               print "<a href=\"$self";
+               my $u= $self;
                my $delim2= '?';
                foreach my $nav2 (@navsettings) {
                    my $current2= $nav2->{Variable};  $current2= $$current2;
                    $current2= $couldbe if $nav2->{Param} eq $nav->{Param};
                    next if $current2 eq $nav2->{Default};
-                   print $delim2, "$nav2->{Param}=$current2";
+                   $u .= $delim2;  $u .= "$nav2->{Param}=$current2";
                    $delim2= '&';
                }
-               print "\">$show</a>";
+               print a({href=>$u}, $show);
            }
            $delim= ' | ';
        }
@@ -297,8 +297,7 @@ if ($detail) {
            my $tsloth= $xsloth + $g->{Slower};
            my $imgurl= "$self?graph=$detail&section=$section".
                "&sloth=$tsloth&elem=$elem";
-           print "<a href=\"$imgurl&w=780&h=800\">";
-           print "<img src=\"$imgurl\"></a>\n";
+           print a({href=>"$imgurl&w=780&h=800"}, img({src=>$imgurl}));
        }
     }
     print end_html();
@@ -328,14 +327,13 @@ if (param('debug')) {
 start_page("$section graphs");
 
 foreach my $group (@{ $section_groups{$section} }) {
-    print "<a href=\"$self?detail=$group&section=$section\">";
+    print a({href=>"$self?detail=$group&section=$section"});
     my $imgurl= "$self?graph=$group&section=$section";
     my $elems= $group_elems{$section,$group};
     if (@$elems > 1) { print "<table><tr><td>"; }
     foreach my $elem (@$elems) {
        my $g= $graphs{$section,$group,$elem};
-       print "<img src=\"$imgurl&elem=$elem&sloth=".
-           ($sloth + $g->{Slower})."\">";
+       print img({src=>"$imgurl&elem=$elem&sloth=".($sloth + $g->{Slower})});
     }
     if (@$elems > 1) { print "</td></tr></table>"; }
     print "</a>\n";