HTML-StripScripts-Parser

 view release on metacpan or  search on metacpan

t/10basic.t  view on Meta::CPAN


test( '<table> </table>', '<table> </table>', 'filter text' );

test( 'x<?xml version="1.0" encoding="utf-8"?>y',
      'x<!--filtered-->y',
      'filter process'
);

test( 'x<!-- foo -->y', 'x<!--filtered-->y', 'filter comment' );

test( 'x<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"' . "\n"
          . '   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">y',
      'x<!--filtered-->y',
      'filter declaration'
);

{

    package MyFilter;
    use base qw(HTML::StripScripts::Parser);

t/50flow.t  view on Meta::CPAN

           q{foo<!--filtered-->pah}
        ],

#   [ 'SSI unclosed',      q{foo<!--# exec "/tmp/grunion"}, q{foo&lt;!--# exec &quot;/tmp/grunion&quot;} ],
#   [ 'SSI misclosed',     q{foo<!--# exec "/tmp/grunion" >}, q{foo&lt;!--# exec &quot;/tmp/grunion&quot; &gt;} ],
        [  'xml metatag',
           q{x<?xml version="1.0" encoding="utf-8"?>y},
           q{x<!--filtered-->y}
        ],
        [ 'doctype', <<'END', "<!--filtered-->\n" ],
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
END
        [  'trailing garbage',
           q{<i /(&(&(&(*%&^^*%&*&%)>hello},
           q{<i>hello</i>}
        ],
        [  'newline confusion', qq{<foo>\n<foo>},
           qq{<!--filtered-->\n<!--filtered-->}
        ],



( run in 1.448 second using v1.01-cache-2.11-cpan-49f99fa48dc )