--- Webpacus/lib/Webpacus/Controller/Editor.pm 2005/11/27 15:14:54 179 +++ Webpacus/lib/Webpacus/Controller/Editor.pm 2005/12/14 18:56:11 241 @@ -4,6 +4,7 @@ use warnings; use base 'Catalyst::Controller'; +use HTML::Tidy; use Data::Dumper; =head1 NAME @@ -139,6 +140,8 @@ $c->stash->{'css_content'} = $webpac->load_html( $css_full_path ); + $c->stash->{'css_list'} = [ qw/user.css foobar.css/ ]; + $c->stash->{template} = 'editor/css.tt'; } @@ -168,10 +171,55 @@ 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__; +
+