W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2004

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

From: Martin Duerst <duerst@dev.w3.org>
Date: Wed, 22 Sep 2004 00:53:56 +0000
To: www-validator-cvs@w3.org
Message-ID: <E1C9vOO-0005bI-HD@lionel-hutz.w3.org>

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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:02:07 UTC