From 918c82308a8b489cc5f179f4e18531ad12cd6692 Mon Sep 17 00:00:00 2001 From: Nodir Turakulov Date: Fri, 4 Sep 2015 18:07:55 -0700 Subject: [PATCH] html/template: preserve attr in stateBeforeValue Context: #12149. The problem there is that contents of `, - context{state: stateCSSLineCmt, delim: delimDoubleQuote}, + context{state: stateCSSLineCmt, delim: delimDoubleQuote, attr: attrStyle}, }, { "`, + context{}, }, } diff --git a/src/html/template/transition.go b/src/html/template/transition.go index d2e028741a..aefe0355af 100644 --- a/src/html/template/transition.go +++ b/src/html/template/transition.go @@ -169,7 +169,7 @@ func tBeforeValue(c context, s []byte) (context, int) { case '"': delim, i = delimDoubleQuote, i+1 } - c.state, c.delim, c.attr = attrStartStates[c.attr], delim, attrNone + c.state, c.delim = attrStartStates[c.attr], delim return c, i }