diff options
author | link <link@localhost> | 2002-10-27 09:05:55 +0000 |
---|---|---|
committer | link <link@localhost> | 2002-10-27 09:05:55 +0000 |
commit | ca6215486c562889d165deed061ff40448593b23 (patch) | |
tree | 30503f93fb0a20437ad934d06d424d42fb184da9 | |
parent | 9b99412e890afdd6744ffd034be14bd18676f49d (diff) | |
download | markup-validator-ca6215486c562889d165deed061ff40448593b23.zip markup-validator-ca6215486c562889d165deed061ff40448593b23.tar.gz markup-validator-ca6215486c562889d165deed061ff40448593b23.tar.bz2 |
Fix to detect the new DOCTYPE when the override is in effect. &preparse was
being too clever for it's own good and bailing out early if it had already
seen a DOCTYPE. Since we call &preparse both before and after &supress_dtd,
the new DOCTYPE was never seen by &preparse. Thanks to Bjoern Hoerhmann.
-rwxr-xr-x | httpd/cgi-bin/check | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index cbb54b4..ee4461b 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.270 2002-10-27 08:34:22 link Exp $ +# $Id: check,v 1.271 2002-10-27 09:05:55 link Exp $ # # Disable buffering on STDOUT! @@ -95,7 +95,7 @@ BEGIN { # # Strings - $VERSION = q$Revision: 1.270 $; + $VERSION = q$Revision: 1.271 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; @@ -157,7 +157,7 @@ $File->{'Header'} = &prepSSI({ }); $File->{'Footer'} = &prepSSI({ File => $CFG->{'Footer'}, - Date => q$Date: 2002-10-27 08:34:22 $, + Date => q$Date: 2002-10-27 09:05:55 $, }); # @@ -1817,6 +1817,12 @@ EOF sub preparse { 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; @@ -1847,7 +1853,6 @@ sub preparse { $p->ignore_elements('BODY'); $p->ignore_elements('body'); $p->handler(declaration => $dtd, 'text'); - # $p->handler(process => $pi, 'text'); $p->handler(start => $start, 'tag,attr'); $p->parse(join "\n", @{$File->{Content}}); |