From 96f5f211071a80ac3be647e502cbbb22f97d3db8 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 8 Apr 2017 18:07:40 +0200 Subject: [PATCH 1/1] charset: coalesce and abbreviate rowspan>3 Hide useless whitespace of huge CJK blocks; only indicate start and end rows. --- charset.plp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/charset.plp b/charset.plp index b1c680e..18d7c50 100644 --- a/charset.plp +++ b/charset.plp @@ -303,11 +303,22 @@ sub range_cell { } elsif (my $rows = int($len / $cols)) { # multiple full rows + my $rowsize = $colsize * $cols; if ($len -= $rows * $cols) { # partial row remains - $table->{$offset + $colsize*$rows * $cols} //= [$len*$colsize, "$class joinu", '', $title]; + $table->{$offset + $rowsize * $rows} //= [$len*$colsize, "$class joinu", '', $title]; $class .= ' joind'; } + + # coalesce multiple rows + while ($rows > 3) { + $info->{skip}->{$offset += $rowsize}++; + $rows--; + } + if ($rows > 2) { + $info->{skip}->{$offset += $rowsize} = 0; + } + $attr .= sprintf ' rowspan=%d', $rows; $len = $cols; } @@ -346,7 +357,10 @@ for my $row (@request) { } print ''; - { + if (defined $row->{skip}->{$offset}) { + print '⋮'; + } + else { if (my $rowmod = $offset % $rowdiv) { # offset in column units printf '+%X', $rowmod; -- 2.30.0