summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-10-09 13:35:11 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-10-09 13:35:11 -0400
commit1b6b1ee2d8f2e148bca301b177713ca35d2b8691 (patch)
treeb6a1e777470af46f57fae0e7ae3731c87942722a /IkiWiki/Plugin
parente0b0b57211e8fe609c09a37605a21f42a6d734d3 (diff)
brokenlinks: use pagespec_match_list
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/brokenlinks.pm13
1 files changed, 5 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
index 62a0a42f4..8ee734bf9 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}, 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];