- my $match=match_glob($page, "$glob/*", internal => 1, @_);
- if ($match && exists $IkiWiki::pagesources{$page}) {
- my $type=IkiWiki::pagetype($IkiWiki::pagesources{$page});
- if (defined $type && $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") {