X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7ee7773e2acd97c81a20a877400e8126e981b424..1108348923809188a213097bf5a9abc43c896fa6:/IkiWiki/Plugin/brokenlinks.pm diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index 9e65f52c6..2318298fe 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -23,18 +23,15 @@ sub preprocess (@) { my %params=@_; $params{pages}="*" unless defined $params{pages}; - # Needs to update whenever the links on a page change. - add_depends($params{page}, $params{pages}, links => 1); - 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]; @@ -42,7 +39,7 @@ sub preprocess (@) { htmllink($page, $params{destpage}, $link, noimageinline => 1), join(", ", map { htmllink($params{page}, $params{destpage}, $_, noimageinline => 1) - } @pages) + } sort @pages) ); }