From: Ian Jackson Date: Mon, 5 Oct 2020 16:23:54 +0000 (+0100) Subject: sg-report-flight: Word-wrapping improvements to job and step names X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cb66c56c7712463d5b29f7eed0297966a5e72045;p=osstest.git sg-report-flight: Word-wrapping improvements to job and step names Use . Signed-off-by: Ian Jackson --- diff --git a/sg-report-flight b/sg-report-flight index 33f953c..a07e03c 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}{} ? (''. $& . '⁠') : ''; + $b.encode_entities($_); + } split m{(?=$re)}, $s; +} + sub htmloutjob ($$) { my ($fi,$job) = @_; return unless defined $htmldir; @@ -1666,11 +1675,9 @@ END print H "\n"; foreach my $col (@cols) { - my $th= $col; - $th =~ s/\-/ $&/g; print H ""; print H ""; - print H encode_entities($th); + print H encode_with_wbrs($col); print H ""; print H ""; } @@ -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, "",$worst[3],""; push @worstrow2, "",$worst[0],"";