brokenlinks: use pagespec_match_list

master
Joey Hess 2009-10-09 13:35:11 -04:00
parent e0b0b57211
commit 1b6b1ee2d8
1 changed files with 5 additions and 8 deletions

View File

@ -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}, deptype("links"));
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];