Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #903 from dwarring/pod-table-fix
Browse files Browse the repository at this point in the history
handle uneven rows lengths in Pod::To::Text::table2text()
  • Loading branch information
lizmat committed Oct 12, 2016
2 parents faba645 + 5a79e22 commit 7af9ec9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Pod/To/Text.pm6
Expand Up @@ -67,8 +67,9 @@ sub table2text($pod) {
my @rows = $pod.contents;
@rows.unshift($pod.headers.item) if $pod.headers;
my @maxes;
for 0..(@rows[1].elems - 1) -> $i {
@maxes.push([max] @rows.map({ $_[$i].chars }));
my $cols = [max] @rows.map({ .elems });
for 0..^$cols -> $i {
@maxes.push([max] @rows.map({ $i < $_ ?? $_[$i].chars !! 0 }));
}
my $ret;
if $pod.config<caption> {
Expand Down

0 comments on commit 7af9ec9

Please sign in to comment.