summaryrefslogtreecommitdiff
path: root/libgo/go/html/escape.go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-04 15:01:11 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-04 15:01:11 +0000
commitc92b1bc7f829182c2a5276ebd4567f54f6cc713d (patch)
treedf1037674f2c69011469485414315a50607f9d08 /libgo/go/html/escape.go
parentc4ded1f63a3daf6467bd2caa4a1f4807f4983830 (diff)
downloadgcc-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.go8
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 = "&amp;"
case '\'':
- esc = "&apos;"
+ // "&#39;" is shorter than "&apos;" and apos was not in HTML until HTML5.
+ esc = "&#39;"
case '<':
esc = "&lt;"
case '>':
esc = "&gt;"
case '"':
- esc = "&quot;"
+ // "&#34;" is shorter than "&quot;".
+ esc = "&#34;"
default:
panic("unrecognized escape character")
}
@@ -231,7 +233,7 @@ func escape(w writer, s string) error {
}
// EscapeString escapes special characters like "<" to become "&lt;". 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 {