aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/text/template
diff options
context:
space:
mode:
authorNigel Tao <nigeltao@golang.org>2012-04-12 09:35:43 +1000
committerNigel Tao <nigeltao@golang.org>2012-04-12 09:35:43 +1000
commit6277656d69640da9166bbac2a132a3ddee61dcac (patch)
tree6f4080c783f61ea8edd829c8afb329d9ee408628 /src/pkg/text/template
parent772e8ff4584ac6b97d8f3c38f0b21161ca72fe81 (diff)
downloadgo-6277656d69640da9166bbac2a132a3ddee61dcac.tar.xz
html, exp/html: escape ' and " as &#39; and &#34;, since IE8 and
below do not support &apos;. This makes package html consistent with package text/template's HTMLEscape function. Fixes #3489. R=rsc, mikesamuel, dsymonds CC=golang-dev https://golang.org/cl/5992071
Diffstat (limited to 'src/pkg/text/template')
-rw-r--r--src/pkg/text/template/funcs.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/text/template/funcs.go b/src/pkg/text/template/funcs.go
index 525179cb49..8fbf0ef50a 100644
--- a/src/pkg/text/template/funcs.go
+++ b/src/pkg/text/template/funcs.go
@@ -246,7 +246,7 @@ func not(arg interface{}) (truth bool) {
var (
htmlQuot = []byte("&#34;") // shorter than "&quot;"
- htmlApos = []byte("&#39;") // shorter than "&apos;"
+ htmlApos = []byte("&#39;") // shorter than "&apos;" and apos was not in HTML until HTML5
htmlAmp = []byte("&amp;")
htmlLt = []byte("&lt;")
htmlGt = []byte("&gt;")