Skip to content

Commit

Permalink
Merge pull request #1345 from metacpan/haarg/indexed-normalized
Browse files Browse the repository at this point in the history
use normalized documentation name when comparing to module name
  • Loading branch information
haarg authored Feb 2, 2025
2 parents d1a4eb8 + bc36d7b commit f72eadb
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions lib/MetaCPAN/Document/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -932,16 +932,22 @@ sub set_indexed {
);
}

$self->_set_indexed(
(
if ( my $doc_name = $self->documentation ) {

# .pm file with no package declaration but pod should be indexed
!@{ $self->module } ||
# normalize the documentation name for comparison the same way module
# names are normalized
my $normalized_doc_name = $doc_name =~ s{'}{::}gr;
$self->_set_indexed(
(
# .pm file with no package declaration but pod should be indexed
!@{ $self->module } ||

# don't index if the documentation doesn't match any of its modules
!!grep { $self->documentation eq $_->name } @{ $self->module }
) ? true : false
) if ( $self->documentation );
grep { $normalized_doc_name eq $_->name }
@{ $self->module }
) ? true : false
);
}
}

=head2 set_authorized
Expand Down

0 comments on commit f72eadb

Please sign in to comment.