]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/orphans.pm
* Fix orphans plugin to not count a link to a nonexistant page as a reason
[ikiwiki.git] / IkiWiki / Plugin / orphans.pm
index f8035db54b2de8d64426e7e54a14593f1c78eeb8..12b9d2e5236a1512dcb53f1a01b9d097b29d93c0 100644 (file)
@@ -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;
        }