From b39bbf1e5b908070ee348c1ba6006da8ff1374c8 Mon Sep 17 00:00:00 2001 From: Andrew Balholm Date: Wed, 18 Apr 2012 13:26:35 +1000 Subject: [PATCH] exp/html: adjust beforeHTMLIM to match spec Add case for doctype tokens (which are ignored). This CL does not change the status of any tests. R=golang-dev, nigeltao CC=golang-dev https://golang.org/cl/6061047 --- src/pkg/exp/html/parse.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pkg/exp/html/parse.go b/src/pkg/exp/html/parse.go index 04f4ae7533..6e433785fd 100644 --- a/src/pkg/exp/html/parse.go +++ b/src/pkg/exp/html/parse.go @@ -408,6 +408,9 @@ func initialIM(p *parser) bool { // Section 12.2.5.4.2. func beforeHTMLIM(p *parser) bool { switch p.tok.Type { + case DoctypeToken: + // Ignore the token. + return true case TextToken: p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) if len(p.tok.Data) == 0 { -- 2.48.1