diff --git a/src/pkg/exp/template/html/context.go b/src/pkg/exp/template/html/context.go index 1a3fb44a3e..856d1c94eb 100644 --- a/src/pkg/exp/template/html/context.go +++ b/src/pkg/exp/template/html/context.go @@ -20,13 +20,20 @@ type context struct { delim delim urlPart urlPart jsCtx jsCtx + element element errLine int errStr string } // eq returns whether two contexts are equal. func (c context) eq(d context) bool { - return c.state == d.state && c.delim == d.delim && c.urlPart == d.urlPart && c.jsCtx == d.jsCtx && c.errLine == d.errLine && c.errStr == d.errStr + return c.state == d.state && + c.delim == d.delim && + c.urlPart == d.urlPart && + c.jsCtx == d.jsCtx && + c.element == d.element && + c.errLine == d.errLine && + c.errStr == d.errStr } // state describes a high-level HTML parser state. @@ -47,6 +54,11 @@ const ( stateText state = iota // stateTag occurs before an HTML attribute or the end of a tag. stateTag + // stateComment occurs inside an . + stateComment + // stateRCDATA occurs inside an RCDATA element (`, + context{state: stateText}, + }, + { + `