in reply to Re: Modules or rules to find ill-formatted HTML
in thread Modules or rules to find ill-formatted HTML

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.
  • Comment on Re^2: Modules or rules to find ill-formatted HTML

Replies are listed 'Best First'.
Re^3: Modules or rules to find ill-formatted HTML
by ww (Archbishop) on Oct 09, 2008 at 23:41 UTC

    Unreadable!

    Please use <code>...</code> tags ... and please read Markup in the Monastery

    Now, what you posted appears (XML view) to be intended to render this way:

    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><font size=4>Email Us</a>"; my $tidy = HTML::Tidy->new(); my $clean = $tidy->clean($html); print "Clean HTML:\n---------------------------\n$clean\n";
    This produced incorrect output.

    So, what was the incorrect output? Please also read How do I post a question effectively?.

    ...and on the offchance you don't know what's wrong with your $html, check the quoting, the missing </font> tag, and the H::T docs.