X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/d3e0a54344a8ca5ac0a30af9f0a41cdb08df06ff..1a785a311e8dfa3de88bb36410b8a3a817b9b533:/IkiWiki/Plugin/brokenlinks.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index b8ed2b8de..8ee734bf9 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -23,19 +23,15 @@ sub preprocess (@) { my %params=@_; $params{pages}="*" unless defined $params{pages}; - # Needs to update whenever a page is changed, - # added or removed, in order to see the link changes. - 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];