summaryrefslogtreecommitdiff
path: root/src/pkg/html
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/html')
-rw-r--r--src/pkg/html/parse.go6
-rw-r--r--src/pkg/html/token_test.go2
2 files changed, 6 insertions, 2 deletions
diff --git a/src/pkg/html/parse.go b/src/pkg/html/parse.go
index 2ef90a873..6a2bc1ea6 100644
--- a/src/pkg/html/parse.go
+++ b/src/pkg/html/parse.go
@@ -400,6 +400,7 @@ func inBodyIM(p *parser) (insertionMode, bool) {
p.framesetOK = false
default:
// TODO.
+ p.addElement(p.tok.Data, p.tok.Attr)
}
case EndTagToken:
switch p.tok.Data {
@@ -413,7 +414,10 @@ func inBodyIM(p *parser) (insertionMode, bool) {
p.pop()
}
default:
- // TODO.
+ // TODO: any other end tag
+ if p.tok.Data == p.top().Data {
+ p.pop()
+ }
}
}
if endP {
diff --git a/src/pkg/html/token_test.go b/src/pkg/html/token_test.go
index c17b436aa..c794612ab 100644
--- a/src/pkg/html/token_test.go
+++ b/src/pkg/html/token_test.go
@@ -161,7 +161,7 @@ func TestTokenizer(t *testing.T) {
loop:
for _, tt := range tokenTests {
z := NewTokenizer(bytes.NewBuffer([]byte(tt.html)))
- for i, s := range strings.Split(tt.golden, "$", -1) {
+ for i, s := range strings.Split(tt.golden, "$") {
if z.Next() == ErrorToken {
t.Errorf("%s token %d: want %q got error %v", tt.desc, i, s, z.Error())
continue loop