Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10724)

Issue 5320063: code review 5320063: html: stop at scope marker node when generating implied... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by andybalholm
Modified:
12 years, 5 months ago
Reviewers:
CC:
nigeltao, golang-dev
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : diff -r f26d4fc9845f https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r f26d4fc9845f https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -5 lines) Patch
M src/pkg/html/parse.go View 1 1 chunk +7 lines, -4 lines 0 comments Download
M src/pkg/html/parse_test.go View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4
andybalholm
Hello nigeltao@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 5 months ago (2011-11-01 23:18:09 UTC) #1
nigeltao
LGTM.
12 years, 5 months ago (2011-11-02 00:41:28 UTC) #2
nigeltao
I've made a note in node.go that forTag is no longer used, and will submit.
12 years, 5 months ago (2011-11-02 00:46:52 UTC) #3
nigeltao
12 years, 5 months ago (2011-11-02 00:47:11 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=0f2a700e36fe ***

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
http://codereview.appspot.com/5320063

Committer: Nigel Tao <nigeltao@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b