Commit 0a61c846 authored by Andrew Balholm's avatar Andrew Balholm Committed by Nigel Tao

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
parent 83f61a27
......@@ -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)
......
......@@ -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},
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment