Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions html/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,11 @@ func afterHeadIM(p *parser) bool {
case DoctypeToken:
// Ignore the token.
return true
case ErrorToken:
// Stop parsing.
p.parseImpliedToken(StartTagToken, a.Body, a.Body.String())
p.framesetOK = true
return true
}

p.parseImpliedToken(StartTagToken, a.Body, a.Body.String())
Expand Down
1 change: 1 addition & 0 deletions html/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ func TestParseFragmentForeignContentTemplates(t *testing.T) {
srcs := []string{
"<math><html><template><mn><template></template></template>",
"<math><math><head><mi><template>",
"<svg><head><title><select><input>",
}
for _, src := range srcs {
// The next line shouldn't infinite-loop.
Expand Down