From bca65e395e1786f321266da81fb3ed46f5d4e854 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Thu, 11 Aug 2011 18:49:09 +1000 Subject: [PATCH] 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 --- src/pkg/html/token.go | 2 +- src/pkg/html/token_test.go | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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", -- 2.50.0