aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/html/parse.go
diff options
context:
space:
mode:
authorAndrew Balholm <andybalholm@gmail.com>2011-12-20 10:57:06 +1100
committerNigel Tao <nigeltao@golang.org>2011-12-20 10:57:06 +1100
commita0bd46e70fa09e8fe4749399440a2dc52e80f84a (patch)
tree715c2e5478bc42261d6ab743feaeea4fd3aba21d /src/pkg/html/parse.go
parent315b361f898e2a7f299a742be5cfcb56c04d5c9d (diff)
downloadgo-a0bd46e70fa09e8fe4749399440a2dc52e80f84a.tar.xz
html: ignore <caption>, <col>, <tbody> etc. when parsing table fragments
Pass tests6.dat, test 36: <caption><col><colgroup><tbody><tfoot><thead><tr> | <tr> Pass tests through test 44: <body></body></html> R=nigeltao CC=golang-dev https://golang.org/cl/5494055
Diffstat (limited to 'src/pkg/html/parse.go')
-rw-r--r--src/pkg/html/parse.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go
index a69262115c..6892d8fefa 100644
--- a/src/pkg/html/parse.go
+++ b/src/pkg/html/parse.go
@@ -1206,6 +1206,13 @@ func inTableBodyIM(p *parser) bool {
add = true
data = "tr"
consumed = false
+ case "caption", "col", "colgroup", "tbody", "tfoot", "thead":
+ if !p.popUntil(tableScopeStopTags, "tbody", "thead", "tfoot") {
+ // Ignore the token.
+ return true
+ }
+ p.im = inTableIM
+ return false
default:
// TODO.
}