1
0
mirror of https://github.com/golang/go synced 2024-11-20 04:14:49 -07:00

html: ignore <col> tag outside tables

Pass tests1.dat, test 109:
<table><col><tbody><col><tr><col><td><col></table><col>

| <html>
|   <head>
|   <body>
|     <table>
|       <colgroup>
|         <col>
|       <tbody>
|       <colgroup>
|         <col>
|       <tbody>
|         <tr>
|       <colgroup>
|         <col>
|       <tbody>
|         <tr>
|           <td>
|       <colgroup>
|         <col>

Also pass test 110:
<table><colgroup><tbody><colgroup><tr><colgroup><td><colgroup></table><colgroup>

R=nigeltao
CC=golang-dev
https://golang.org/cl/5369069
This commit is contained in:
Andrew Balholm 2011-11-11 21:44:01 +11:00 committed by Nigel Tao
parent 83f61a27d6
commit 0a61c846ef
2 changed files with 3 additions and 1 deletions

View File

@ -667,6 +667,8 @@ func inBodyIM(p *parser) (insertionMode, bool) {
case "image":
p.tok.Data = "img"
return inBodyIM, false
case "caption", "col", "colgroup", "frame", "head", "tbody", "td", "tfoot", "th", "thead", "tr":
// Ignore the token.
default:
// TODO.
p.addElement(p.tok.Data, p.tok.Attr)

View File

@ -133,7 +133,7 @@ func TestParser(t *testing.T) {
n int
}{
// TODO(nigeltao): Process all the test cases from all the .dat files.
{"tests1.dat", 109},
{"tests1.dat", 111},
{"tests2.dat", 0},
{"tests3.dat", 0},
}