diff options
| author | Andrew Balholm <andybalholm@gmail.com> | 2011-12-20 10:57:06 +1100 |
|---|---|---|
| committer | Nigel Tao <nigeltao@golang.org> | 2011-12-20 10:57:06 +1100 |
| commit | a0bd46e70fa09e8fe4749399440a2dc52e80f84a (patch) | |
| tree | 715c2e5478bc42261d6ab743feaeea4fd3aba21d /src/pkg/html/parse.go | |
| parent | 315b361f898e2a7f299a742be5cfcb56c04d5c9d (diff) | |
| download | go-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.go | 7 |
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. } |
