mirror of https://github.com/golang/go.git
html/template: add available godoc link
Change-Id: I50404dbf0f10ee59007bd0dc5353f38e056a0430 Reviewed-on: https://go-review.googlesource.com/c/go/+/650655 Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
7a33f793e8
commit
a2c959fe97
|
|
@ -173,16 +173,16 @@ var htmlEscaper = strings.NewReplacer(
|
|||
|
||||
// EscapeString escapes special characters like "<" to become "<". It
|
||||
// escapes only five such characters: <, >, &, ' and ".
|
||||
// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't
|
||||
// [UnescapeString](EscapeString(s)) == s always holds, but the converse isn't
|
||||
// always true.
|
||||
func EscapeString(s string) string {
|
||||
return htmlEscaper.Replace(s)
|
||||
}
|
||||
|
||||
// UnescapeString unescapes entities like "<" to become "<". It unescapes a
|
||||
// larger range of entities than EscapeString escapes. For example, "á"
|
||||
// larger range of entities than [EscapeString] escapes. For example, "á"
|
||||
// unescapes to "á", as does "á" and "á".
|
||||
// UnescapeString(EscapeString(s)) == s always holds, but the converse isn't
|
||||
// UnescapeString([EscapeString](s)) == s always holds, but the converse isn't
|
||||
// always true.
|
||||
func UnescapeString(s string) string {
|
||||
i := strings.IndexByte(s, '&')
|
||||
|
|
|
|||
Loading…
Reference in New Issue