Skip to content

Commit f72eadb

Browse files
authored
Merge pull request #1345 from metacpan/haarg/indexed-normalized
use normalized documentation name when comparing to module name
2 parents d1a4eb8 + bc36d7b commit f72eadb

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Diff for: lib/MetaCPAN/Document/File.pm

+13-7
Original file line numberDiff line numberDiff line change
@@ -932,16 +932,22 @@ sub set_indexed {
932932
);
933933
}
934934

935-
$self->_set_indexed(
936-
(
935+
if ( my $doc_name = $self->documentation ) {
937936

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

941945
# don't index if the documentation doesn't match any of its modules
942-
!!grep { $self->documentation eq $_->name } @{ $self->module }
943-
) ? true : false
944-
) if ( $self->documentation );
946+
grep { $normalized_doc_name eq $_->name }
947+
@{ $self->module }
948+
) ? true : false
949+
);
950+
}
945951
}
946952

947953
=head2 set_authorized

0 commit comments

Comments
 (0)