prune: do not prune beyond an optional base directory, and add a test
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
index 687c8a48f3dfc16f9e933af1ae77a62ce4918344..a50c4b7b79dbe2ba9b3ab932a365cf315c2d1d21 100644 (file)
@@ -26,7 +26,7 @@ sub import {
        # Hook to change to do pinging since it's called late.
        # This ensures each page only pings once and prevents slow
        # pings interrupting page builds.
-       hook(type => "change", id => "inline", call => \&IkiWiki::pingurl);
+       hook(type => "rendered", id => "inline", call => \&IkiWiki::pingurl);
 }
 
 sub getopt () {
@@ -211,7 +211,8 @@ sub preprocess_inline (@) {
                        }
                }
 
-               @list = map { bestlink($params{page}, $_) }
+               @list = grep { $_ ne '' } 
+                       map { bestlink($params{page}, $_) }
                        split ' ', $params{pagenames};
 
                if (yesno($params{reverse})) {