--- Webpacus/lib/Webpacus/Controller/Editor.pm 2005/11/27 15:14:54 179 +++ Webpacus/lib/Webpacus/Controller/Editor.pm 2005/11/27 18:18:11 181 @@ -4,6 +4,7 @@ use warnings; use base 'Catalyst::Controller'; +use HTML::Tidy; use Data::Dumper; =head1 NAME @@ -168,10 +169,53 @@ my $webpac = $c->comp('Model::WebPAC'); + my $html = $webpac->record( mfn => $mfn, template => $template_filename ); + + if ($html) { + $c->log->debug('check html with tidy'); + my $tidy = new HTML::Tidy; + $tidy->ignore( text => [ + qr/DOCTYPE/, qr/unsupported/, qr/proprietary/i, + qr/invalid character code/, + qr/inserting missing 'title' element/, + qr/lacks "summary" attribute/, + ] ); + + my @lines = split( "\n", $html ); + $_ = "$_\n" for @lines; + + if ( $tidy->parse('tidy', @lines) ) { + if ( $tidy->messages ) { + $html .= <<__TIDY_CLOSE__; +
+