use strict; use Test::More; use HTML::TagFilter; BEGIN { plan (tests => 7); } my $tf = HTML::TagFilter->new( log_rejects => 0, strip_comments => 1, ); my $tf2 = HTML::TagFilter->new( skip_mailto_entification => 1, skip_ltgt_entification => 1, ); is( $tf->filter(qq|hello|), qq|hello|, "quote unquote loophole closed"); is( $tf->filter(qq||), qq||, "malicious src attribute stripped out"); is( $tf->filter(qq|hello|), qq|hello|, "malicious href attribute stripped out"); is( $tf->filter(qq|will|), qq|will|, "mailto obfuscated"); is( $tf2->filter(qq|will|), qq|will|, "mailto obfuscation switched off"); is( $tf->filter(qq|

What's this -->

|), qq|

What's this -->

|, "angle and ' entified"); is( $tf2->filter(qq|

What's this -->

|), qq|

What's this -->

|, "entification switched off");