diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-09-16 19:18:02 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-09-16 19:18:02 +0000 |
commit | 6bcc3339d911cd6c0095a3ed3eacf8560c458d01 (patch) | |
tree | 57f583463364ab74ef8675e8a0f1c230d0bd93a1 /IkiWiki/Plugin | |
parent | 2ab0fdeffc04515b97f4eb86efa2468fe69654e7 (diff) |
* table plugin: Actually specify the delimiter.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/table.pm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/table.pm b/IkiWiki/Plugin/table.pm index 01ba5e504..be97137ed 100644 --- a/IkiWiki/Plugin/table.pm +++ b/IkiWiki/Plugin/table.pm @@ -40,10 +40,12 @@ sub preprocess (@) { #{{{ my @data; if (lc $params{format} eq 'csv') { - @data=split_csv($params{data}, $params{delimiter}); + @data=split_csv($params{data}, + defined $params{delimiter} ? $params{delimiter} : ",",); } elsif (lc $params{format} eq 'dsv') { - @data=split_dsv($params{data}, $params{delimiter}); + @data=split_dsv($params{data}, + defined $params{delimiter} ? $params{delimiter} : "|",); } else { return "[[table ".gettext("unknown data format")."]]"; @@ -95,7 +97,7 @@ sub split_csv ($$) { #{{{ eval q{use Text::CSV}; error($@) if $@; my $csv = Text::CSV->new({ - sep_char => defined $delimiter ? $delimiter : ",", + sep_char => $delimiter, binary => 1, allow_loose_quotes => 1, }) || error("could not create a Text::CSV object"); |