From f823f4ef52602a35f5ff3eae51165db1cb78232c Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 8 Apr 2017 23:11:44 +0200 Subject: [PATCH] charset: cols option to override table width Properly implemented configuration to replace doubling hack (trailing +). --- charset.plp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/charset.plp b/charset.plp index 8996c58..33e5db4 100644 --- a/charset.plp +++ b/charset.plp @@ -78,7 +78,7 @@ sub tabinput { state $ALIAS = { default => [qw( unicode+0-639 utf-8 iso-8859-1 iso-8859-15 cp1252 cp437 cp850 )], - uc => [qw( U++ unicode+0-4095 unicode+4096-6319 unicode+6320-8191 )], + uc => [qw( U+cols=32 unicode+0-4095 unicode+4096-6319 unicode+6320-8191 )], us => [qw( cp437 cp863 gsm0338 AdobeStandardEncoding )], ebcdic => [qw( cp37 cp500 cp1047 posix-bc cp1026 cp875 )], iso => [map {"iso-8859-$_"} 1 .. 11, 13 .. 16], @@ -221,13 +221,11 @@ sub tabinput { $visible->{$_} //= 0 for $row{parent} || (); } - if (length $params) { - # manual option to double table width - $row{cols} *= 2 if $params =~ s/[+]\z//; - } - for my $param (split /[+]+/, $params // '') { - if ($param =~ m{ \A (? \d+) (?: [-] (? \d+) )? \z }x) { + if ($param =~ m{ \A cols = (\d+) \z }x) { + $row{cols} = $1; + } + elsif ($param =~ m{ \A (? \d+) (?: [-] (? \d+) )? \z }x) { if ($row{offset}) { my $skip = int(($row{endpoint} || $row{offset}) / $row{cols}); for ($skip + 1 .. ($+{offset} / $row{cols}) - 1) { -- 2.30.0