1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!perl
use strict;
use warnings;
use HTML::Restrict;
use Scalar::Util;
use Test::More;
my $hr = HTML::Restrict->new( debug => 0 );
my $html = q[<style type="text/css">
hr {color:sienna;}
p {margin-left:20px;}
body {background-image:url("images/back40.gif");}
</style>];
is( $hr->process($html), undef, "content of style tag removed by default" );
$hr->set_rules( { style => ['type'] } );
is( $hr->process($html), $html, "content of style tag preserved" );
done_testing();
|