1
0
mirror of https://github.com/golang/go synced 2024-11-21 13:34:39 -07:00

effective go: fix erroneous quoting of ampersands that cropped up

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4937047
This commit is contained in:
Rob Pike 2011-08-23 13:54:29 +10:00
parent 03e9ea5b74
commit 6731d47f99
3 changed files with 4 additions and 6 deletions

View File

@ -2954,8 +2954,7 @@ const templateStr = `
</head>
<body>
{{if .}}
<img src="http://chart.apis.google.com/chart?chs=300x300&cht=qr&choe=UTF-8&chl={{urlquery .}}"
/>
<img src="http://chart.apis.google.com/chart?chs=300x300&cht=qr&choe=UTF-8&chl={{urlquery .}}" />
<br>
{{html .}}
<br>
@ -2994,7 +2993,7 @@ from data items passed to <code>templ.Execute</code>, in this case the
form value.
Within the template text (<code>templateStr</code>),
double-brace-delimited pieces denote template actions.
The piece from the <code>{{if .}}</code>
The piece from <code>{{if .}}</code>
to <code>{{end}}</code> executes only if the value of the current data item, called <code>.</code> (dot),
is non-empty.
That is, when the string is empty, this piece of the template is suppressed.

View File

@ -2884,7 +2884,7 @@ from data items passed to <code>templ.Execute</code>, in this case the
form value.
Within the template text (<code>templateStr</code>),
double-brace-delimited pieces denote template actions.
The piece from the <code>{{html "{{if .}}"}}</code>
The piece from <code>{{html "{{if .}}"}}</code>
to <code>{{html "{{end}}"}}</code> executes only if the value of the current data item, called <code>.</code> (dot),
is non-empty.
That is, when the string is empty, this piece of the template is suppressed.

View File

@ -31,8 +31,7 @@ const templateStr = `
</head>
<body>
{{if .}}
<img src="http://chart.apis.google.com/chart?chs=300x300&amp;cht=qr&amp;choe=UTF-8&amp;chl={{urlquery .}}"
/>
<img src="http://chart.apis.google.com/chart?chs=300x300&cht=qr&choe=UTF-8&chl={{urlquery .}}" />
<br>
{{html .}}
<br>