+
+ # Special case for unsaved attachments.
+ foreach my $page (@pages) {
+ if ($attachment && IkiWiki::Plugin::attachment->can("is_held_attachment")) {
+ my $f=IkiWiki::Plugin::attachment::is_held_attachment($page);
+ if (defined $f) {
+ require IkiWiki::Render;
+ IkiWiki::prune($f, "$config{wikistatedir}/attachments");
+ }
+ }
+ }
+ @pages=grep { exists $pagesources{$_} } @pages;
+ return unless @pages;