diff options
author | duerst <duerst@localhost> | 2004-09-22 00:53:54 +0000 |
---|---|---|
committer | duerst <duerst@localhost> | 2004-09-22 00:53:54 +0000 |
commit | bc4c419099d5acc15e40fd006236fdebced3303b (patch) | |
tree | fb6e2c82afdd198083b9f432e5753386f9b91f9a /httpd/cgi-bin/check | |
parent | de20aaf3ee4009da585591f1a6e3e6a38936301f (diff) | |
download | markup-validator-bc4c419099d5acc15e40fd006236fdebced3303b.zip markup-validator-bc4c419099d5acc15e40fd006236fdebced3303b.tar.gz markup-validator-bc4c419099d5acc15e40fd006236fdebced3303b.tar.bz2 |
simplified preparse_meta
Diffstat (limited to 'httpd/cgi-bin/check')
-rwxr-xr-x | httpd/cgi-bin/check | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index adb2b09..f635e30 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -9,7 +9,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.345 2004-09-22 00:48:37 duerst Exp $ +# $Id: check,v 1.346 2004-09-22 00:53:54 duerst Exp $ # # Disable buffering on STDOUT! @@ -225,7 +225,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.345 $; + $VERSION = q$Revision: 1.346 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -2168,16 +2168,10 @@ sub is_mathml {shift->{Type} =~ m(mathml\+xml$)}; # # 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 @@ sub preparse_meta { } else { $File->{Root} = $tag; } - if ($attr->{xmlns}) {$File->{Namespace} = $attr->{xmlns}}; }; my $p = HTML::Parser->new(api_version => 3); @@ -2211,11 +2204,6 @@ sub preparse_meta { $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; } |