]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/inline.pm
Merge commit 'upstream/master' into pub/po
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
index 551c38a65157c64aef2fd6d8629eb9c18eeb2ee6..27ea1c4a64bf8ebca3be99755c86a08a2192cb65 100644 (file)
@@ -183,20 +183,9 @@ sub preprocess_inline (@) {
                $params{template} = $archive ? "archivepage" : "inlinepage";
        }
 
-       my @list;
-       my $lastmatch;
-       foreach my $page (keys %pagesources) {
-               next if $page eq $params{page};
-               $lastmatch=pagespec_match($page, $params{pages}, location => $params{page});
-               if ($lastmatch) {
-                       push @list, $page;
-               }
-       }
-
-       if (! @list && defined $lastmatch &&
-           $lastmatch->isa("IkiWiki::ErrorReason")) {
-               error(sprintf(gettext("cannot match pages: %s"), $lastmatch));
-       }
+       my @list=pagespec_match_list(
+               [ grep { $_ ne $params{page} } keys %pagesources ],
+               $params{pages}, location => $params{page});
 
        if (exists $params{sort} && $params{sort} eq 'title') {
                @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list;
@@ -353,7 +342,7 @@ sub preprocess_inline (@) {
                                        my $content=get_inline_content($page, $params{destpage});
                                        $template->param(content => $content);
                                }
-                               $template->param(pageurl => urlto(bestlink($params{page}, $page), $params{destpage}));
+                               $template->param(pageurl => urlto($page, $params{destpage}));
                                $template->param(inlinepage => $page);
                                $template->param(title => pagetitle(basename($page)));
                                $template->param(ctime => displaytime($pagectime{$page}, $params{timeformat}));