1
0
mirror of https://github.com/golang/go synced 2024-09-23 21:20:13 -06:00

doc/go1.14: disable text/template processing in HTML page

HTML pages served by the website have the option to opt-in to template
processing, by including "Template: true" in the page metadata.
This functionality is documented at
403f1254bd/godoc/template.go (L5-L30).

Historically, the Go 1 release notes have used template processing
to a great extent, but release notes for all subsequent major Go
releases have not.

Since this feature is generally not used and not very well known,
it tends to do more harm than good by making it possible for errors
in the template to prevent the release notes from showing up at all.

Disable this feature for Go 1.14 release notes and onwards.
We can consider enabling it when there's a stronger need for it.

Fixes #37072
Updates #37070

Change-Id: If93553d52df12544b46c4edcf3aa5eddc2a155ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/218058
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Dmitri Shuralyov 2020-02-05 19:24:55 -05:00
parent dd0aa799eb
commit ee3a3717aa

View File

@ -1,7 +1,6 @@
<!--{
"Title": "Go 1.14 Release Notes",
"Path": "/doc/go1.14",
"Template": true
"Path": "/doc/go1.14"
}-->
<!--
@ -829,8 +828,8 @@ appropriately.)
The text/template package now correctly reports errors when a
parenthesized argument is used as a function.
This most commonly shows up in erroneous cases like
<code>{{"{{"}}if (eq .F "a") or (eq .F "b"){{"}}"}}</code>.
This should be written as <code>{{"{{"}}if or (eq .F "a") (eq .F "b"){{"}}"}}</code>.
<code>{{if (eq .F "a") or (eq .F "b")}}</code>.
This should be written as <code>{{if or (eq .F "a") (eq .F "b")}}</code>.
The erroneous case never worked as expected, and will now be
reported with an error <code>can't give argument to non-function</code>.
</p>