]> Cypherpunks repositories - gostls13.git/commitdiff
exp/html: adjust beforeHTMLIM to match spec
authorAndrew Balholm <andybalholm@gmail.com>
Wed, 18 Apr 2012 03:26:35 +0000 (13:26 +1000)
committerNigel Tao <nigeltao@golang.org>
Wed, 18 Apr 2012 03:26:35 +0000 (13:26 +1000)
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

index 04f4ae7533494312ae79bf591ff33902daa3bceb..6e433785fdbdcdd3e82a5cb3aa99c8018225a9c1 100644 (file)
@@ -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 {