aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2007-12-16 16:42:18 -0500
committerJoey Hess <joey@kitenet.net>2007-12-16 16:42:18 -0500
commitc3fed25ad4d301a8e901cf46ba9d11dbf6866d03 (patch)
treebc115228ce56390f169d87557dd833b4387a207f /IkiWiki
parentb17ee42a2775b78329b3d26041f07243ca41841a (diff)
downloadikiwiki-c3fed25ad4d301a8e901cf46ba9d11dbf6866d03.tar
ikiwiki-c3fed25ad4d301a8e901cf46ba9d11dbf6866d03.tar.gz
* brokenlinks: Don't list the same link multiple times. (%links might
contain multiple copies of the same link)
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/brokenlinks.pm3
1 files changed, 3 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm
index ef5837a58..0295a8fe6 100644
--- a/IkiWiki/Plugin/brokenlinks.pm
+++ b/IkiWiki/Plugin/brokenlinks.pm
@@ -22,7 +22,10 @@ sub preprocess (@) { #{{{
foreach my $page (keys %links) {
if (pagespec_match($page, $params{pages}, location => $params{page})) {
my $discussion=gettext("discussion");
+ my %seen;
foreach my $link (@{$links{$page}}) {
+ next if $seen{$link};
+ $seen{$link}=1;
next if $link =~ /.*\/\Q$discussion\E/i && $config{discussion};
my $bestlink=bestlink($page, $link);
next if length $bestlink;