#!perl -T use warnings; use strict; use Test::More tests => 3; use HTML::Tidy; my $args = { newline => 'Lf' }; my $tidy = HTML::Tidy->new($args); isa_ok( $tidy, 'HTML::Tidy' ); $tidy->ignore( type => TIDY_INFO ); # clean once $tidy->ignore( text => qr/DOCTYPE/ ); my $html = 'This is a test.'; my $clean = $tidy->clean( $html ); # then verify that it meets tidy's high standards $tidy = HTML::Tidy->new($args); # reset messages; $tidy->ignore( type => TIDY_INFO ); $clean = $tidy->clean($clean); my @messages = $tidy->messages( $clean ); is_deeply( \@messages, [], q{The cleaned stuff shouldn't have any errors} ); $clean =~ s/"(HTML Tidy|tidyp).+w3\.org"/"Tidy"/; my $expected = do { local $/ = undef; }; is( $clean, $expected, 'Cleaned up properly' ); __DATA__ This is a test.