diff options
Diffstat (limited to 'IkiWiki/Setup')
-rw-r--r-- | IkiWiki/Setup/Standard.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index d88dc9e1c..ed4331d61 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -29,15 +29,21 @@ sub dumpline ($$$$) { #{{{ my $dumpedvalue; if ($type eq 'boolean' || $type eq 'integer') { + # avoid quotes $dumpedvalue=$value; } + elsif ($type eq 'string' && ref $value eq 'ARRAY' && @$value && + ! grep { /[^-A-Za-z0-9_]/ } @$value) { + # dump simple array as qw{} + $dumpedvalue="[qw{ ".join(" ", @$value)." }]"; + } else { $dumpedvalue=Dumper($value); chomp $dumpedvalue; $dumpedvalue=~s/^\t//; } - return "\t$prefix$key=$dumpedvalue,"; + return "\t$prefix$key => $dumpedvalue,"; } #}}} sub dumpvalues ($@) { #{{{ |