summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorot <ot@localhost>2008-08-15 19:29:27 +0000
committerot <ot@localhost>2008-08-15 19:29:27 +0000
commiteca0d19e8ed5c40f0240ba6892149f72926cd689 (patch)
tree956121a5cb6e4c3c4a33596ded49f33ee6178552
parent7ab0c5a5600b8f78be998dab2f78c83c433334ca (diff)
downloadmarkup-validator-eca0d19e8ed5c40f0240ba6892149f72926cd689.zip
markup-validator-eca0d19e8ed5c40f0240ba6892149f72926cd689.tar.gz
markup-validator-eca0d19e8ed5c40f0240ba6892149f72926cd689.tar.bz2
making sure HTML5 plays nice with doctype override
-rw-r--r--htdocs/config/types.conf22
-rwxr-xr-xhttpd/cgi-bin/check21
2 files changed, 35 insertions, 8 deletions
diff --git a/htdocs/config/types.conf b/htdocs/config/types.conf
index 10e65e9..decbffb 100644
--- a/htdocs/config/types.conf
+++ b/htdocs/config/types.conf
@@ -1,7 +1,7 @@
#
# Main Document Type Database for the W3C Markup Validation Service.
#
-# $Id: types.conf,v 1.40 2008-08-11 20:09:24 ot Exp $
+# $Id: types.conf,v 1.41 2008-08-15 19:29:27 ot Exp $
#
# Maintains all information for each of the document types we support.
# See 'perldoc Config::General' for the syntax, and be aware that the
@@ -267,6 +267,26 @@
</Badge>
</HTML_4_01_Frameset>
+<HTML5>
+ Name = html
+ Display = HTML5
+ Info URL = http://www.w3.org/TR/html5/
+ <Types>
+ Allowed = text/html application/xhtml+xml
+ #
+ </Types>
+ # <Badge>
+ # URI = http://www.w3.org/Icons/valid-html401
+ # ALT URI = http://www.w3.org/Icons/valid-html401-blue
+ # Local URI = images/valid_icons/valid-html401
+ # Local ALT URI = images/valid_icons/valid-html401-blue
+ # Height = 31
+ # Width = 88
+ # Alt = Valid HTML 4.01 Frameset
+ # </Badge>
+</HTML5>
+
+
<XHTML_1_0_Strict>
Name = html
Display = XHTML 1.0 Strict
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 98c033f..ff279b5 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -14,7 +14,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.595 2008-08-15 18:52:49 ot Exp $
+# $Id: check,v 1.596 2008-08-15 19:29:27 ot Exp $
#
# Disable buffering on STDOUT!
@@ -191,7 +191,7 @@ Directory not readable (permission denied): @_r
#
# Strings
- $VERSION = q$Revision: 1.595 $;
+ $VERSION = q$Revision: 1.596 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
@@ -844,7 +844,7 @@ sub html5_validate (\$) {
$ua->default_header(Cache_control=> "max-age=0");
my $res = $ua->request(POST "$CFG->{External}->{HTML5}", Content_Type => 'form-data',
- Content => [out => "xml", parser=>$html5_parser, content => $File->{Bytes}]);
+ Content => [out => "xml", parser=>$html5_parser, content => join "\n", @{$File->{Content}}]);
if (! $res->is_success()) {
$File->{'Error Flagged'} = TRUE;
$File->{Templates}->{Error}->param(fatal_no_checker => TRUE);
@@ -1749,10 +1749,17 @@ sub override_doctype {
my $pubid = $dt->{PubID};
my $sysid = $dt->{SysID};
my $name = $dt->{Name};
- local $dtd = qq(<!DOCTYPE $name PUBLIC "$pubid");
- $dtd .= qq( "$sysid") if $sysid; # We don't have one for all types.
- $dtd .= '>';
-
+ local $dtd;
+
+ if (($pubid ne "") and ($sysid ne "")) {
+ $dtd = qq(<!DOCTYPE $name PUBLIC "$pubid");
+ $dtd .= qq( "$sysid") if $sysid; # We don't have one for all types.
+ $dtd .= '>';
+ }
+ else {
+ $dtd = qq(<!DOCTYPE $name>);
+ }
+
local $org_dtd = '';
local $HTML = '';
local $seen = FALSE;