- my $match=match_glob($page, "$glob/*", @_);
- if ($match) {
- my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
- if ($type ne "_comment") {
+ if (! $postcomment) {
+ # To see if it's a comment, check the source file type.
+ # Deal with comments that were just deleted.
+ my $source=exists $IkiWiki::pagesources{$page} ?
+ $IkiWiki::pagesources{$page} :
+ $IkiWiki::delpagesources{$page};
+ my $type=defined $source ? IkiWiki::pagetype($source) : undef;
+ if (! defined $type || $type ne "_comment") {