diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-04 15:01:11 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-05-04 15:01:11 +0000 |
commit | c92b1bc7f829182c2a5276ebd4567f54f6cc713d (patch) | |
tree | df1037674f2c69011469485414315a50607f9d08 /libgo/go/html/escape.go | |
parent | c4ded1f63a3daf6467bd2caa4a1f4807f4983830 (diff) | |
download | gcc-c92b1bc7f829182c2a5276ebd4567f54f6cc713d.tar.gz |
libgo: Update to Go 1.0.1 release.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187163 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/html/escape.go')
-rw-r--r-- | libgo/go/html/escape.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libgo/go/html/escape.go b/libgo/go/html/escape.go index fee771a5784..24cb7af8524 100644 --- a/libgo/go/html/escape.go +++ b/libgo/go/html/escape.go @@ -210,13 +210,15 @@ func escape(w writer, s string) error { case '&': esc = "&" case '\'': - esc = "'" + // "'" is shorter than "'" and apos was not in HTML until HTML5. + esc = "'" case '<': esc = "<" case '>': esc = ">" case '"': - esc = """ + // """ is shorter than """. + esc = """ default: panic("unrecognized escape character") } @@ -231,7 +233,7 @@ func escape(w writer, s string) error { } // EscapeString escapes special characters like "<" to become "<". It -// escapes only five such characters: amp, apos, lt, gt and quot. +// escapes only five such characters: <, >, &, ' and ". // UnescapeString(EscapeString(s)) == s always holds, but the converse isn't // always true. func EscapeString(s string) string { |