HTML-StripScripts-LibXML
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::LibXML);
q{foo<!--filtered-->pah}
],
# [ 'SSI unclosed', q{foo<!--# exec "/tmp/grunion"}, q{foo<!--# exec "/tmp/grunion"} ],
# [ 'SSI misclosed', q{foo<!--# exec "/tmp/grunion" >}, q{foo<!--# exec "/tmp/grunion" >} ],
[ '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.300 second using v1.01-cache-2.11-cpan-49f99fa48dc )