mirror of
https://github.com/golang/go.git
synced 2024-09-30 23:07:22 +00:00
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
This commit is contained in:
parent
315b361f89
commit
a0bd46e70f
@ -1206,6 +1206,13 @@ func inTableBodyIM(p *parser) bool {
|
|||||||
add = true
|
add = true
|
||||||
data = "tr"
|
data = "tr"
|
||||||
consumed = false
|
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:
|
default:
|
||||||
// TODO.
|
// TODO.
|
||||||
}
|
}
|
||||||
|
@ -172,7 +172,7 @@ func TestParser(t *testing.T) {
|
|||||||
{"tests3.dat", -1},
|
{"tests3.dat", -1},
|
||||||
{"tests4.dat", -1},
|
{"tests4.dat", -1},
|
||||||
{"tests5.dat", -1},
|
{"tests5.dat", -1},
|
||||||
{"tests6.dat", 36},
|
{"tests6.dat", 45},
|
||||||
{"tests10.dat", 13},
|
{"tests10.dat", 13},
|
||||||
}
|
}
|
||||||
for _, tf := range testFiles {
|
for _, tf := range testFiles {
|
||||||
|
Loading…
Reference in New Issue
Block a user