table: Fix misparsed links in external files
authorJoey Hess <joey@gnu.kitenet.net>
Tue, 6 Jan 2009 20:05:09 +0000 (15:05 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Tue, 6 Jan 2009 20:05:09 +0000 (15:05 -0500)
linkify data from external files at the same time as data from an inlined
table would be linkified.

IkiWiki/Plugin/table.pm
debian/changelog
doc/bugs/links_misparsed_in_CSV_files.mdwn

index 479f3d7450612fa63b3355aa9a3870c32cfeea6c..dd124929d6bbacf704dfc9cab0cdd1d1b597c6be 100644 (file)
@@ -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} : "|",);
        }
index f8eb49030fd6480f1a8f5cba7dd911463a55b6fa..bf47fda044b4cae086821ab7d4114d7d81e63419 100644 (file)
@@ -1,3 +1,9 @@
+ikiwiki (3.02) UNRELEASED; urgency=low
+
+  * table: Fix misparsed links in external files.
+
+ -- Joey Hess <joeyh@debian.org>  Tue, 06 Jan 2009 15:02:52 -0500
+
 ikiwiki (3.01) unstable; urgency=low
 
   * ikiwiki-makerepo: Fix injecting of empty mercurial and bzr repositories.
index 4dae4aeabe3ffaaea1846790b545f71ff527c3bd..27d2b7b1e95b1825f6d8923e5d637cf0204501fd 100644 (file)
@@ -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.