summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/orphans.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-06-25 07:21:53 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-06-25 07:21:53 +0000
commit5fa878cc75447f7a93565843c5a172fed0c3e73d (patch)
tree56725fab76a35a05816044ec4f0d74a48a60b00b /IkiWiki/Plugin/orphans.pm
parentc55076d8e8797c938779a9ffdadcf37bbe83ecca (diff)
* Fix orphans plugin to not count a link to a nonexistant page as a reason
for a page not being an orphan.
Diffstat (limited to 'IkiWiki/Plugin/orphans.pm')
-rw-r--r--IkiWiki/Plugin/orphans.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm
index f8035db54..12b9d2e52 100644
--- a/IkiWiki/Plugin/orphans.pm
+++ b/IkiWiki/Plugin/orphans.pm
@@ -31,7 +31,11 @@ sub preprocess (@) { #{{{
next unless IkiWiki::globlist_match($page, $params{pages});
# If the page has a link to some other page, it's
# indirectly linked to a page via that page's backlinks.
- next if grep { length $_ && ($_ !~/\/Discussion$/i || ! $IkiWiki::config{discussion}) && IkiWiki::bestlink($page, $_) ne $page } @{$IkiWiki::links{$page}};
+ next if grep {
+ length $_ &&
+ ($_ !~ /\/Discussion$/i || ! $IkiWiki::config{discussion}) &&
+ IkiWiki::bestlink($page, $_) !~ /^($page|)$/
+ } @{$IkiWiki::links{$page}};
push @orphans, $page;
}