From: Andrew Balholm Date: Wed, 18 Apr 2012 03:26:35 +0000 (+1000) Subject: exp/html: adjust beforeHTMLIM to match spec X-Git-Tag: go1.1rc2~3368 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b39bbf1e5b908070ee348c1ba6006da8ff1374c8;p=gostls13.git 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 --- 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 {