validator/httpd/cgi-bin check,1.345,1.346

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv21509

Modified Files:
	check 
Log Message:
simplified preparse_meta

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.345
retrieving revision 1.346
diff -u -d -r1.345 -r1.346
--- check	22 Sep 2004 00:48:37 -0000	1.345
+++ check	22 Sep 2004 00:53:54 -0000	1.346
@@ -2168,16 +2168,10 @@
 
 #
 # Do an initial parse of the Document Entity to extract charset from HTML <meta>.
-# (still also extracts FPI)
+# (still also extracts FPI, at least to some extent)
 sub preparse_meta {
   my $File = shift;
 
-  #
-  # Reset DOCTYPE, Root, and Charset (for second invocation).
-  $File->{Charset}->{META} = '';
-  $File->{DOCTYPE}         = '';
-  $File->{Root}            = '';
-
   my $dtd = sub {
     return if $File->{Root};
     ($File->{Root}, $File->{DOCTYPE}) = shift =~  m(<!DOCTYPE\s+(\w+)\s+PUBLIC\s+(?:[\'\"])([^\"\']+)(?:[\"\']).*>)si;
@@ -2200,7 +2194,6 @@
     } else {
       $File->{Root} = $tag;
     }
-    if ($attr->{xmlns}) {$File->{Namespace} = $attr->{xmlns}};
   };
 
   my $p = HTML::Parser->new(api_version => 3);
@@ -2211,11 +2204,6 @@
   $p->handler(start => $start, 'tag,attr');
   $p->parse(join "\n", @{$File->{Content}});
 
-  $File->{DOCTYPE} = '' unless defined $File->{DOCTYPE};
-  $File->{DOCTYPE} =~ s(^\s+){ }g;
-  $File->{DOCTYPE} =~ s(\s+$){ }g;
-  $File->{DOCTYPE} =~ s(\s+) { }g;
-
   return $File;
 }
 

Received on Wednesday, 22 September 2004 00:53:56 UTC