Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
modernized POD renderer a bit
  • Loading branch information
kraih committed Mar 17, 2013
1 parent 89a50ed commit 07a19fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

3.91 2013-03-15
3.91 2013-03-17
- Improved tests.
- Fixed whitespace bug in Mojo::DOM::HTML.

Expand Down
7 changes: 2 additions & 5 deletions lib/Mojolicious/Plugin/PODRenderer.pm
Expand Up @@ -4,7 +4,7 @@ use Mojo::Base 'Mojolicious::Plugin';
use Mojo::Asset::File;
use Mojo::ByteStream 'b';
use Mojo::DOM;
use Mojo::Util 'url_escape';
use Mojo::Util qw(slurp url_escape);
use Pod::Simple::HTML;
use Pod::Simple::Search;

Expand Down Expand Up @@ -44,10 +44,7 @@ sub _perldoc {
my $path = Pod::Simple::Search->new->find($module, @PATHS);
return $self->redirect_to("http://metacpan.org/module/$module")
unless $path && -r $path;

# Turn POD into HTML
open my $file, '<', $path;
my $html = _pod_to_html(join '', <$file>);
my $html = _pod_to_html(slurp $path);

# Rewrite links
my $dom = Mojo::DOM->new("$html");
Expand Down

0 comments on commit 07a19fd

Please sign in to comment.