]> Cypherpunks repositories - gostls13.git/commitdiff
html/template: adjust ambiguous URL context text
authorRuss Cox <rsc@golang.org>
Wed, 19 Oct 2016 17:14:16 +0000 (13:14 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 19 Oct 2016 17:40:43 +0000 (17:40 +0000)
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>

src/html/template/error.go
src/html/template/escape.go
src/html/template/escape_test.go

index 5637384bd86329fc00221403f9b66ed06b0a82b9..cbcaf92e4ab1a312fe2ce5aa8ca46304eb7dad91 100644 (file)
@@ -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}}
index dcc0b8a531a95c3ef592e6b74d2ebb8c64818749..0e7d2be143b5d9d5c2d9e3dd0978bfd1e2d43513 100644 (file)
@@ -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())
index b7ccd8542575caffdbd255d2426c1a8ef26a0b12..f6ace496e7b214d4d6cb77969f4aceb9370a799d 100644 (file)
@@ -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 \`,