I recently tried cleaning up following HTML and got problem. The end quote was missing on an attribute value.
use strict;
use warnings;
use HTML::Tidy;
my $html="<a href=\"mailto:test\@test.net>Email Us";
my $tidy = HTML::Tidy->new();
my $clean = $tidy->clean($html);
print "Clean HTML:\n---------------------------\n$clean\n";
This produced incorrect output.