From: Nigel Tao Date: Thu, 11 Aug 2011 08:49:09 +0000 (+1000) Subject: html: parse more malformed tags. X-Git-Tag: weekly.2011-08-17~72 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bca65e395e1786f321266da81fb3ed46f5d4e854;p=gostls13.git html: parse more malformed tags. This continues the work in revision 914a659b44ff, now passing more test cases. As before, the new tokenization tests match html5lib's behavior. Fixes #2124. R=dsymonds, r CC=golang-dev https://golang.org/cl/4867042 --- diff --git a/src/pkg/html/token.go b/src/pkg/html/token.go index fddc922d60..d266b3a300 100644 --- a/src/pkg/html/token.go +++ b/src/pkg/html/token.go @@ -429,7 +429,7 @@ loop: for ; i < z.p1; i++ { c := z.buf[i] switch c { - case '<', '>', '"', '\'', '/', '=': + case '>', '/', '=': break loop } switch { diff --git a/src/pkg/html/token_test.go b/src/pkg/html/token_test.go index 1330f3247a..0a0beb201b 100644 --- a/src/pkg/html/token_test.go +++ b/src/pkg/html/token_test.go @@ -49,14 +49,24 @@ var tokenTests = []tokenTest{ }, { "malformed tag #1", + `

`, + `

`, + }, + { + "malformed tag #2", `

`, `

`, }, { - "malformed tag #2", + "malformed tag #3", `

`, }, + { + "malformed tag #4", + `

`, + `

`, + }, // Comments. { "comment0",