HTML-Tidy5

 view release on metacpan or  search on metacpan

t/opt-00.t  view on Meta::CPAN


my $input=<<'EOD';
<h1>example</h1>
Here's some <B>ed and <BR/>eakfest MarkUp: <!-- ... -->
<font color="#0000FF" color="RED">...</font>
<p></P>
EOD

my $expected =<<'EOD';
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
</title>
<style type="text/css">
/*<![CDATA[*/
 span.myprefix-1 {color: blue}
/*]]>*/
</style>

t/too-many-titles.t  view on Meta::CPAN

is( scalar @returned, 1, 'Exactly one warning returned' );

# Tidy 5.6.0 returns "too many title elements in <title>" instead of "too many title elements in <head>".
# When this gets fixed, make this like() into an is().
# https://github.com/htacg/tidy-html5/issues/692
like( $returned[0], qr/^- \(3:5\) Warning: too many title elements in <(head|title)>$/, 'Error message matches' );

exit 0;

__DATA__
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <HEAD>
        <TITLE>Test stuff</TITLE>
        <TITLE>As if one title isn't enough</TITLE>
    </HEAD>
    <BODY BGCOLOR="white">
        <P>This is my paragraph</P>
    </BODY>
</HTML>



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