From 6bcc3339d911cd6c0095a3ed3eacf8560c458d01 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 16 Sep 2007 19:18:02 +0000 Subject: * table plugin: Actually specify the delimiter. --- IkiWiki/Plugin/table.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'IkiWiki/Plugin') 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"); -- cgit v1.2.3