aboutsummaryrefslogtreecommitdiff
path: root/src/html
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-10-19 13:14:16 -0400
committerRuss Cox <rsc@golang.org>2016-10-19 17:40:43 +0000
commitd2315fdc11ebdf5c0ae94f33cb01ffaab82c00b6 (patch)
tree168e965c087b3b113405c2500ad594ae0f38d80d /src/html
parent13c65723419a41a8b5339e11f40fe2ecf0bbc8ab (diff)
downloadgo-d2315fdc11ebdf5c0ae94f33cb01ffaab82c00b6.tar.xz
html/template: adjust ambiguous URL context text
Before: ... appears in an ambiguous URL context. After: ... appears in an ambiguous context within a URL. It's a minor point, but it's confused multiple people. Try to make clearer that the ambiguity is "where exactly inside the URL?" Fixes #17319. Change-Id: Id834868d1275578036c1b00c2bdfcd733d9d2b7b Reviewed-on: https://go-review.googlesource.com/31465 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/html')
-rw-r--r--src/html/template/error.go2
-rw-r--r--src/html/template/escape.go2
-rw-r--r--src/html/template/escape_test.go2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/html/template/error.go b/src/html/template/error.go
index 5637384bd8..cbcaf92e4a 100644
--- a/src/html/template/error.go
+++ b/src/html/template/error.go
@@ -44,7 +44,7 @@ const (
// OK indicates the lack of an error.
OK ErrorCode = iota
- // ErrAmbigContext: "... appears in an ambiguous URL context"
+ // ErrAmbigContext: "... appears in an ambiguous context within a URL"
// Example:
// <a href="
// {{if .C}}
diff --git a/src/html/template/escape.go b/src/html/template/escape.go
index dcc0b8a531..0e7d2be143 100644
--- a/src/html/template/escape.go
+++ b/src/html/template/escape.go
@@ -161,7 +161,7 @@ func (e *escaper) escapeAction(c context, n *parse.ActionNode) context {
case urlPartUnknown:
return context{
state: stateError,
- err: errorf(ErrAmbigContext, n, n.Line, "%s appears in an ambiguous URL context", n),
+ err: errorf(ErrAmbigContext, n, n.Line, "%s appears in an ambiguous context within a URL", n),
}
default:
panic(c.urlPart.String())
diff --git a/src/html/template/escape_test.go b/src/html/template/escape_test.go
index b7ccd85425..f6ace496e7 100644
--- a/src/html/template/escape_test.go
+++ b/src/html/template/escape_test.go
@@ -903,7 +903,7 @@ func TestErrors(t *testing.T) {
},
{
`<a href="{{if .F}}/foo?a={{else}}/bar/{{end}}{{.H}}">`,
- "z:1:47: {{.H}} appears in an ambiguous URL context",
+ "z:1:47: {{.H}} appears in an ambiguous context within a URL",
},
{
`<a onclick="alert('Hello \`,