summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <devnull@localhost>2014-08-05 20:50:31 +0000
committercorvid <devnull@localhost>2014-08-05 20:50:31 +0000
commit78316e89902cb44e456467eebaccfcb9f5899bbe (patch)
tree744bd3a9b6987eee5e084a2c6e285ef1e8db5329
parent521dcf77bd4f37320c24806e850ad2d8751331d7 (diff)
html5 doctype, whitespace permitted between "html" and '>'
...not only permitted, but seen sometimes. Why anyone would do that, I don't know. Maybe to make certain browsers fail.
-rw-r--r--src/html.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/html.cc b/src/html.cc
index a8c70879..3c110664 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -1559,7 +1559,6 @@ static int
static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize)
{
static const char HTML_SGML_sig [] = "<!DOCTYPE HTML PUBLIC ";
- static const char HTML5_sig [] = "<!DOCTYPE html>";
static const char HTML20 [] = "-//IETF//DTD HTML";
static const char HTML32 [] = "-//W3C//DTD HTML 3.2";
static const char HTML40 [] = "-//W3C//DTD HTML 4.0";
@@ -1624,7 +1623,8 @@ static void Html_parse_doctype(DilloHtml *html, const char *tag, int tagsize)
html->DocType = DT_HTML;
html->DocTypeVersion = 2.0f;
}
- } else if (!dStrAsciiCasecmp(ntag, HTML5_sig)) {
+ } else if (!dStrAsciiCasecmp(ntag, "<!DOCTYPE html>") ||
+ !dStrAsciiCasecmp(ntag, "<!DOCTYPE html >")) {
html->DocType = DT_HTML;
html->DocTypeVersion = 5.0f;
}