This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
[migrating a few items of interest from todo.html to bugzilla] For HTML document types (probably doesn't make sense for math, smil, svg?), the validation results could be interfaced with tidy. One idea would be to add, afterthe "this document is not valid X" banner, a paragraph saying "you can try to clean up your markup automatically with HTML tidy". Implementation-wise, Bjoern, do you have any idea which would be the best choice? µTidylib? ptidy? Just a popen() / system() seems to be popular too, but probably isn't the best in terms of security/ resources. Related to, but not duplicate of, AFAICT, Bug #76
What about simply linking to http://cgi.w3.org/cgi-bin/tidy?docAddr=<uri_of_validate_page> ? Or do you think it needs to be more integrated than that in the validation service?
Working on it, looking at using HTML::Tidy perl module
Any chance of making it optional, available only if HTML::Tidy is installed?
(In reply to comment #3) > Any chance of making it optional, available only if HTML::Tidy is installed? It would be optional for the user, but I suspect that's not what you're meaning here, is it? I think we would have the checkbox option regardless of whether HTML::Tidy is present, but in the results we could have a "sorry, this server does not have HTML::Tidy" installed error message instead of a harsher 500 fatal error becausew HTML::Tidy was not in @INC.
(In reply to comment #3) > Any chance of making it optional, available only if HTML::Tidy is installed? Like this? =================================================================== RCS file: /sources/public/validator/httpd/cgi-bin/check,v retrieving revision 1.468 diff -u -r1.468 check --- check 7 Feb 2007 15:24:29 -0000 1.468 +++ check 8 Feb 2007 10:35:24 -0000 @@ -56,7 +56,6 @@ use Encode::Alias qw(); use HTML::Encoding 0.52 qw(); use SGML::Parser::OpenSP qw(); -use HTML::Tidy qw(); ############################################################################### #### Constant definitions. #################################################### @@ -691,8 +690,17 @@ ## if invalid content, pass through tidy if (! $File->{'Is Valid'}) { - my $tidy = HTML::Tidy->new(); - $File->{'Tidy'} = $tidy->clean(join"\n",@{$File->{Content}}); + eval { + local $SIG{__DIE__}; + require HTML::Tidy; + my $tidy = HTML::Tidy->new(); + $File->{'Tidy'} = $tidy->clean(join"\n",@{$File->{Content}}); + $File->{'Tidy_OK'} = TRUE; + }; + if ($@) { + $File->{'Tidy_OK'} = FALSE; + } + }
Yep, something like that, thanks.
*** Bug 76 has been marked as a duplicate of this bug. ***
Suggestion by Ville in comment #3 and detailed in comment #5 implemented in code, Tidy functionality now effectively working in 0.8.0dev, closing this RFE.