File: style.t

package info (click to toggle)
libhtml-restrict-perl 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 364 kB
  • sloc: perl: 842; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 465 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!perl

use strict;
use warnings;

use HTML::Restrict ();
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();