HTML-LinkFilter

 view release on metacpan or  search on metacpan

xt/forkn.jp.01-index.t  view on Meta::CPAN

my $filter = HTML::LinkFilter->new;
$filter->change( $html, \&callback );

( my $got = $filter->html ) =~ s{ \s* \z}{}msx;
$wish =~ s{ \s* \z}{}msx;

is_string( encode_utf8( $got ), encode_utf8( $wish ) );

__DATA__
@@ wish.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="http://foo.forkn.jp/js/jquery-ui/css/eggplant/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" />
<link href="http://foo.forkn.jp/css/styles.css" media="screen" rel="stylesheet" type="text/css" />
<link href="http://foo.forkn.jp/css/main.css" media="screen" rel="stylesheet" type="text/css" />
<link href="http://foo.forkn.jp/css/portal.css" media="screen" rel="stylesheet" type="text/css" />
<link href="http://foo.forkn.jp/css/member.css" media="screen" rel="stylesheet" type="text/css" />

xt/forkn.jp.01-index.t  view on Meta::CPAN

var pageTracker = _gat._getTracker("");
pageTracker._trackPageview();
} catch(err) {}</script>

</div>

</body>
</html>

@@ index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link href="/js/jquery-ui/css/eggplant/jquery-ui-1.8.12.custom.css" rel="stylesheet" type="text/css" />
<link href="/css/styles.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/css/main.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/css/portal.css" rel="stylesheet" type="text/css" media="screen" />
<link href="/css/member.css" rel="stylesheet" type="text/css" media="screen" />



( run in 0.833 second using v1.01-cache-2.11-cpan-411bb0df24b )