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";
|