]> Cypherpunks repositories - gostls13.git/commitdiff
doc/go1.14: disable text/template processing in HTML page
authorDmitri Shuralyov <dmitshur@golang.org>
Thu, 6 Feb 2020 00:24:55 +0000 (19:24 -0500)
committerDmitri Shuralyov <dmitshur@golang.org>
Thu, 6 Feb 2020 01:09:50 +0000 (01:09 +0000)
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
https://github.com/golang/tools/blob/403f1254bdfd3da27c92a0e9e37dd180a9a82b3c/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>
doc/go1.14.html

index ec7f8e4f433315d3d1b2842cf4d2854eb959aca9..4e7381b90042a6ec4b4decfe7141708292346c7e 100644 (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>