[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 82/82] sg-report-flight: Word-wrapping improvements to job and step names



Use <wbr>.

Signed-off-by: Ian Jackson <iwj@xxxxxxxxxxxxxx>
---
 sg-report-flight | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/sg-report-flight b/sg-report-flight
index 33f953ca..a07e03cb 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -1185,6 +1185,15 @@ sub nullcols {
     join ", ", map { m/::/ ? "NULL::$' as $`" : "NULL as $_" } @_;
 }
 
+sub encode_with_wbrs ($) {
+    my ($s) = @_;
+    my $re = qr{[-/]};
+    join '', map {
+       my $b = s{^$re}{} ? ('<wbr>'. $& . '&#8288;') : '';
+       $b.encode_entities($_);
+    } split m{(?=$re)}, $s;
+}
+
 sub htmloutjob ($$) {
     my ($fi,$job) = @_;
     return unless defined $htmldir;
@@ -1666,11 +1675,9 @@ END
     print H "</th>\n";
 
     foreach my $col (@cols) {
-        my $th= $col;
-        $th =~ s/\-/ $&/g;
         print H "<th>";
         print H "<a href=\"".encode_entities($col)."/$htmlleaf\">";
-        print H encode_entities($th);
+        print H encode_with_wbrs($col);
         print H "</a>";
         print H "</th>";
     }
@@ -1726,7 +1733,8 @@ END
            next if $this[1] == $worst[1] && $ei->{Step}{status} ne 'pass';
            @worst=@this;
            push @worst,
-               encode_entities("$ei->{Step}{stepno}. $ei->{Step}{testid}");
+             encode_entities("$ei->{Step}{stepno}. ").
+             encode_with_wbrs($ei->{Step}{testid});
        }
        push @worstrow1, "<td ",$worst[2],">",$worst[3],"</td>";
        push @worstrow2, "<td ",$worst[2],">",$worst[0],"</td>";
-- 
2.20.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.