]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/brokenlinks.pm
update for rename of recentchanges.mdwn to __8226____9__Get_CAll___64___1__42__855...
[git.ikiwiki.info.git] / IkiWiki / Plugin / brokenlinks.pm
index eb698b0bef9f7b2c9df90b342dcfac56c79a1795..2318298fe4726c31017c250cf5b57c96b8866640 100644 (file)
@@ -23,19 +23,15 @@ sub preprocess (@) {
        my %params=@_;
        $params{pages}="*" unless defined $params{pages};
        
-       # Needs to update whenever a page is added or removed, so
-       # register a dependency.
-       add_depends($params{page}, $params{pages});
-       
        my @broken;
        foreach my $link (keys %IkiWiki::brokenlinks) {
                next if $link =~ /.*\/\Q$config{discussionpage}\E/i && $config{discussion};
 
-               my @pages;
-               foreach my $page (@{$IkiWiki::brokenlinks{$link}}) {
-                       push @pages, $page
-                               if pagespec_match($page, $params{pages}, location => $params{page});
-               }
+               my @pages=pagespec_match_list($params{page}, $params{pages},
+                       list => $IkiWiki::brokenlinks{$link},
+                       # needs to update when links on a page change
+                       deptype => deptype("links")
+               );
                next unless @pages;
 
                my $page=$IkiWiki::brokenlinks{$link}->[0];
@@ -43,7 +39,7 @@ sub preprocess (@) {
                        htmllink($page, $params{destpage}, $link, noimageinline => 1),
                        join(", ", map {
                                htmllink($params{page}, $params{destpage}, $_,  noimageinline => 1)
-                       } @pages)
+                       } sort @pages)
                );
        }