]> Cypherpunks repositories - gostls13.git/commitdiff
html/template: document comment stripping
authorSean Liao <sean@liao.dev>
Sat, 15 Mar 2025 00:14:14 +0000 (00:14 +0000)
committerSean Liao <sean@liao.dev>
Mon, 17 Mar 2025 15:52:14 +0000 (08:52 -0700)
Fixes #28628

Change-Id: I8b68f55f25e62f747d7cc48a490fec7f426f53d1
Reviewed-on: https://go-review.googlesource.com/c/go/+/658115
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/html/template/doc.go

index 4d880738e658e406fc84f75b7d7cb57b5960dd69..38d58669deb8066ab93ee79c46d64b46626e0a06 100644 (file)
@@ -28,6 +28,9 @@ HTML templates treat data values as plain text which should be encoded so they
 can be safely embedded in an HTML document. The escaping is contextual, so
 actions can appear within JavaScript, CSS, and URI contexts.
 
+Comments are stripped from output, except for those passed in via the
+[HTML], [CSS], and [JS] types for their respective contexts.
+
 The security model used by this package assumes that template authors are
 trusted, while Execute's data parameter is not. More details are
 provided below.