]> Cypherpunks repositories - gostls13.git/commit
html: stop at scope marker node when generating implied </a> tags
authorAndrew Balholm <andybalholm@gmail.com>
Wed, 2 Nov 2011 00:47:05 +0000 (11:47 +1100)
committerNigel Tao <nigeltao@golang.org>
Wed, 2 Nov 2011 00:47:05 +0000 (11:47 +1100)
commit22ee5ae25a2997606c28abe721c9052ee0cc9da4
tree38828c283d6057c60a8fd6e606982ae679171c92
parent90b76c0f3e3356e17c03baae3e20a4a11c2a6f10
html: stop at scope marker node when generating implied </a> tags

A <a> tag generates implied end tags for any open <a> elements.
But it shouldn't do that when it is inside a table cell the the open <a>
is outside the table.
So stop the search for an open <a> when we reach a scope marker node.

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

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

Also pass test 79:
<table><a href="blah">aba<tr><td><a href="foo">br</td></tr>x</table>aoe

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