File: empty-element-tags.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 (31 lines) | stat: -rw-r--r-- 556 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
24
25
26
27
28
29
30
31
use strict;
use warnings;

use Test::More;

use HTML::Restrict ();

my $before = <<'EOF';
two element open & close break<br></br>
one element open & close break <br />
one element open & close break no space<br/>
EOF

my $after = <<'EOF';
two element open &amp; close break<br></br>
one element open &amp; close break <br>
one element open &amp; close break no space<br>
EOF

my $hr = HTML::Restrict->new(
    trim  => 0,
    rules => {
        br => [],
    },
);

my $got = $hr->process($before);

is( $got, $after, '<br/> preserved' );

done_testing();