Commit b39bbf1e authored by Andrew Balholm's avatar Andrew Balholm Committed by Nigel Tao

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
parent 90aa56f2
...@@ -408,6 +408,9 @@ func initialIM(p *parser) bool { ...@@ -408,6 +408,9 @@ func initialIM(p *parser) bool {
// Section 12.2.5.4.2. // Section 12.2.5.4.2.
func beforeHTMLIM(p *parser) bool { func beforeHTMLIM(p *parser) bool {
switch p.tok.Type { switch p.tok.Type {
case DoctypeToken:
// Ignore the token.
return true
case TextToken: case TextToken:
p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace) p.tok.Data = strings.TrimLeft(p.tok.Data, whitespace)
if len(p.tok.Data) == 0 { if len(p.tok.Data) == 0 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment