diff options
author | Russ Cox <rsc@golang.org> | 2020-09-10 18:53:26 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2020-10-12 16:30:36 +0000 |
commit | 9384d34c58099657bb1b133beaf3ff37ada9b017 (patch) | |
tree | f1b31fd3061478b340178700e87b2a912aefc8bf /src/html | |
parent | 39b527691495902279da7ac8405a070ded7dd4a2 (diff) | |
download | go-9384d34c58099657bb1b133beaf3ff37ada9b017.tar.gz go-9384d34c58099657bb1b133beaf3ff37ada9b017.zip |
text/template: allow newlines inside action delimiters
This allows multiline constructs like:
{{"hello" |
printf}}
Now that unclosed actions can span multiple lines,
track and report the start of the action when reporting errors.
Also clean up a few "unexpected <error message>" to be just "<error message>".
Fixes #29770.
Change-Id: I54c6c016029a8328b7902a4b6d85eab713ec3285
Reviewed-on: https://go-review.googlesource.com/c/go/+/254257
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/html')
-rw-r--r-- | src/html/template/exec_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/html/template/exec_test.go b/src/html/template/exec_test.go index ec2bfcccab..fc76ee40e5 100644 --- a/src/html/template/exec_test.go +++ b/src/html/template/exec_test.go @@ -1302,7 +1302,7 @@ func TestUnterminatedStringError(t *testing.T) { t.Fatal("expected error") } str := err.Error() - if !strings.Contains(str, "X:3: unexpected unterminated raw quoted string") { + if !strings.Contains(str, "X:3: unterminated raw quoted string") { t.Fatalf("unexpected error: %s", str) } } |