Commit 2f5d2388 authored by Kunpei Sakai's avatar Kunpei Sakai Committed by Nigel Tao

html: avoid panic even if unconsidered <isindex> and <template> combination

The <isindex> element has been removed from the spec so that the
<template> element doesn't cover it.
To avoid panic, this commit adds ignoring code as a workaround.

Fixes golang/go#27704

Change-Id: I847391389285df2fc0eb6a795f8c93b481cdebac
Reviewed-on: https://go-review.googlesource.com/136575Reviewed-by: 's avatarNigel Tao <nigeltao@golang.org>
parent 26e67e76
......@@ -984,6 +984,14 @@ func inBodyIM(p *parser) bool {
p.acknowledgeSelfClosingTag()
p.popUntil(buttonScope, a.P)
p.parseImpliedToken(StartTagToken, a.Form, a.Form.String())
if p.form == nil {
// NOTE: The 'isindex' element has been removed,
// and the 'template' element has not been designed to be
// collaborative with the index element.
//
// Ignore the token.
return true
}
if action != "" {
p.form.Attr = []Attribute{{Key: "action", Val: action}}
}
......
......@@ -11,3 +11,14 @@
| <form>
| <paper-input>
| <style>
#data
<template><tBody><isindex/action=0>
#errors
#document
| <html>
| <head>
| <template>
| content
| <tbody>
| <body>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment