]> Cypherpunks repositories - gostls13.git/commit
html: process </td> tags; foster parent at most one node per token
authorAndrew Balholm <andybalholm@gmail.com>
Tue, 1 Nov 2011 00:42:54 +0000 (11:42 +1100)
committerNigel Tao <nigeltao@golang.org>
Tue, 1 Nov 2011 00:42:54 +0000 (11:42 +1100)
commit9db3f78c392643769fd46fc7900a6deb1fd2692f
treec094631796fafea58dc427c208678bb2e017e82b
parentcae23f036ac639141153a73551bcabbb7169e9e0
html: process </td> tags; foster parent at most one node per token

Correctly close table cell when </td> is read.

Because of reconstructing the active formatting elements, more than one
node may be created when reading a single token.
If both nodes are foster parented, they will be siblings, but the first
node should be the parent of the second.

Pass tests1.dat, test 77:
<a href="blah">aba<table><a href="foo">br<tr><td></td></tr>x</table>aoe

| <html>
|   <head>
|   <body>
|     <a>
|       href="blah"
|       "aba"
|       <a>
|         href="foo"
|         "br"
|       <a>
|         href="foo"
|         "x"
|       <table>
|         <tbody>
|           <tr>
|             <td>
|     <a>
|       href="foo"
|       "aoe"

R=nigeltao
CC=golang-dev
https://golang.org/cl/5305074
src/pkg/html/parse.go
src/pkg/html/parse_test.go