perl: hover experimental identifiers
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 2 Jul 2015 22:00:04 +0000 (00:00 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 21 Sep 2015 22:20:08 +0000 (00:20 +0200)
perl.plp

index fd67342..f5d6f26 100644 (file)
--- a/perl.plp
+++ b/perl.plp
@@ -29,9 +29,16 @@ for my $vernum (reverse sort keys %{$info}) {
        print '<div class="section">'."\n";
        printf '<h2>%vd <small>%s</small></h2><dl>'."\n", $vernum, $verrow->{release};
        for (@{ $verrow->{new} }) {
-               if (my $aside = defined $_->[2] && 'experimental') {
-                       $aside .= sprintf ' until %vd', $_->[2] if ref \$_->[2] eq 'VSTRING';
-                       $_->[1] .= qq{ <em class="ex">($aside)</em>};
+               if (defined (my $experimental = $_->[2])) {
+                       my $title = 'experimental';
+                       my $class = ' class="ex"';
+                       if (ref \$experimental eq 'VSTRING') {
+                               $title .= sprintf ' until %vd', $experimental;
+                       }
+                       elsif ($experimental) {
+                               $class .= sprintf ' title="%s"', $experimental;
+                       }
+                       $_->[1] .= qq{ <em$class>($title)</em>};
                }
                printf '<dt>%s<dd>%s'."\n", @{$_}, '<br/>'
        }