Skip to content

Instantly share code, notes, and snippets.

@omega
Created March 23, 2011 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omega/7dbab8cbfff3451d8e3d to your computer and use it in GitHub Desktop.
Save omega/7dbab8cbfff3451d8e3d to your computer and use it in GitHub Desktop.
my $body = $dom->parse($self->data)->find('html body')->[0];
return unless $body;
# Re-write links XXX: This is ugly!
$body->find->('a[href]')->each(sub {
my $a = shift;
$a->attr('href' => $base . $a->attr('href'));
});
return $body->inner_xml;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment