File: tags.pl

package info (click to toggle)
libhtml-stripscripts-perl 1.06-1%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 492 kB
  • sloc: perl: 1,004; makefile: 2
file content (42 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (5)
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
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl
use strict;
use warnings;

use blib;
use HTML::StripScripts::Parser();
use MyStripScripts();

my $html = <<HTML;
<html>
  <head>
    <title>Test</title>
    <meta http-equiv="content-type" content="text/html" />
    <link type="text/css" rel="stylesheet" href="/styles.css" />
  </head>
  <body>
    Some text
  </body>
</html>
HTML


my $original = HTML::StripScripts::Parser->new({ 
    Context     => 'Document', 
    AllowHref   => 1,
});
print "\nDocument filtered via HTML::StripScripts::Parser:\n";
print   "-------------------------------------------------\n\n";
print $original->filter_html($html);

my $new      = MyStripScripts->new({
    Context     => 'Document', 
    AllowHref   => 1, 
});
print "\n\nDocument filtered via MyStripScripts:\n";
print     "-------------------------------------\n\n";
print $new->filter_html($html);

print "\n\n";