]> Cypherpunks repositories - gostls13.git/commit
encoding/json: stop escaping U+2028 and U+2029 in Compact
authorTom Thorogood <me+google@tomthorogood.co.uk>
Thu, 10 Oct 2019 10:48:00 +0000 (10:48 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 10 Oct 2019 11:31:54 +0000 (11:31 +0000)
commit900ebcfe4d592486dd5bc50f5e8101ba65e32948
tree86ca76dad4a1359cb0da98454f6f0c09b3be8d96
parent3322f3e0ce6e8a8bbdd8e17803887a1f7119a52e
encoding/json: stop escaping U+2028 and U+2029 in Compact

Compact has been inconsistently escaping only some problematic characters
(U+2028 and U+2029), but not others (<, > and &). This change addresses
this inconsistency by removing the escaping of U+2028 and U+2029.

Callers who need to escape the output of Compact should use HTMLEscape
which escapes <, >, &, U+2028 and U+2029.

Fixes #34070
Fixes #30357
Updates #5836

Change-Id: Icfce7691d2b8b1d9b05ba7b64d2d1e4f3b67871b
GitHub-Last-Rev: 38859fe3e2fd586bbd45175c2742f7b123836bf3
GitHub-Pull-Request: golang/go#34804
Reviewed-on: https://go-review.googlesource.com/c/go/+/200217
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/json/indent.go
src/encoding/json/scanner_test.go