Skip to content

Commit

Permalink
switched from search.cpan.org to metacpan.org
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 22, 2011
1 parent fa09bb2 commit f17936b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/Mojolicious/Plugin/PodRenderer.pm
Expand Up @@ -69,8 +69,7 @@ sub register {
my $path = Pod::Simple::Search->new->find($module, @PATHS);

# Redirect to CPAN
my $cpan = 'http://search.cpan.org/perldoc';
return $self->redirect_to("$cpan?$module")
return $self->redirect_to("http://metacpan.org/module/$module")
unless $path && -r $path;

# Turn POD into HTML
Expand All @@ -83,8 +82,9 @@ sub register {
$dom->find('a[href]')->each(
sub {
my $attrs = shift->attrs;
if ($attrs->{href} =~ /^$cpan/) {
$attrs->{href} =~ s/^$cpan\?/$perldoc/;
if ($attrs->{href} =~ /^http\:\/\/search\.cpan\.org\/perldoc/) {
$attrs->{href}
=~ s/^http\:\/\/search\.cpan\.org\/perldoc\?/$perldoc/;
$attrs->{href} =~ s/%3A%3A/\//gi;
}
}
Expand Down

0 comments on commit f17936b

Please sign in to comment.