From da166e74227d084fd15878ce9a3099e07ebcc2c2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Jan 2009 15:05:09 -0500 Subject: [PATCH] table: Fix misparsed links in external files linkify data from external files at the same time as data from an inlined table would be linkified. --- IkiWiki/Plugin/table.pm | 20 ++++++++------------ debian/changelog | 6 ++++++ doc/bugs/links_misparsed_in_CSV_files.mdwn | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/IkiWiki/Plugin/table.pm b/IkiWiki/Plugin/table.pm index 479f3d745..dd124929d 100644 --- a/IkiWiki/Plugin/table.pm +++ b/IkiWiki/Plugin/table.pm @@ -50,22 +50,18 @@ sub preprocess (@) { defined $params{delimiter} ? $params{delimiter} : ",",); # linkify after parsing since html link quoting can # confuse CSV parsing - if (! exists $params{file}) { - @data=map { - [ map { - IkiWiki::linkify($params{page}, - $params{destpage}, $_); - } @$_ ] - } @data; - } + @data=map { + [ map { + IkiWiki::linkify($params{page}, + $params{destpage}, $_); + } @$_ ] + } @data; } elsif (lc $params{format} eq 'dsv') { # linkify before parsing since wikilinks can contain the # delimiter - if (! exists $params{file}) { - $params{data} = IkiWiki::linkify($params{page}, - $params{destpage}, $params{data}); - } + $params{data} = IkiWiki::linkify($params{page}, + $params{destpage}, $params{data}); @data=split_dsv($params{data}, defined $params{delimiter} ? $params{delimiter} : "|",); } diff --git a/debian/changelog b/debian/changelog index f8eb49030..bf47fda04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.02) UNRELEASED; urgency=low + + * table: Fix misparsed links in external files. + + -- Joey Hess Tue, 06 Jan 2009 15:02:52 -0500 + ikiwiki (3.01) unstable; urgency=low * ikiwiki-makerepo: Fix injecting of empty mercurial and bzr repositories. diff --git a/doc/bugs/links_misparsed_in_CSV_files.mdwn b/doc/bugs/links_misparsed_in_CSV_files.mdwn index 4dae4aeab..27d2b7b1e 100644 --- a/doc/bugs/links_misparsed_in_CSV_files.mdwn +++ b/doc/bugs/links_misparsed_in_CSV_files.mdwn @@ -17,7 +17,7 @@ Oh, wait, I see the problem. IkiWiki::linkify is only called if the external fil > > Why is linkify not called for external files? Well, I checked the > history, and it's probably best to say "for historical reasons that no -> longer apply". +> longer apply". So, changed as you suggest. [[done]] --[[Joey]] I am rather confused what this check does, and the fact the comments are very different for CSV and DSV when the code is the same doesn't seem to help. -- 2.44.0