diff options
| author | Dmitry Malikov <malikov.d.y@gmail.com> | 2017-08-05 16:28:40 +0200 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2017-08-06 19:39:17 -0400 |
| commit | e8fe12f83b17dc39d9272d44c4168946fa54e7a0 (patch) | |
| tree | fa79e41db4316ee69cb8f7577efb3c01631827be /compiler | |
| parent | 6ea13e95ff6680c42ca005c70266325a17a9838d (diff) | |
| download | haskell-e8fe12f83b17dc39d9272d44c4168946fa54e7a0.tar.gz | |
Fix string escaping in JSON
It seems to that double quotes is not escaped well at the moment.
We'd noticed this with @alexbiehl during the work on https://github.com/haskell/haddock/pull/645
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/utils/Json.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/Json.hs b/compiler/utils/Json.hs index 1318ce2611..ffbff50641 100644 --- a/compiler/utils/Json.hs +++ b/compiler/utils/Json.hs @@ -39,7 +39,7 @@ escapeJsonString = concatMap escapeChar escapeChar '\n' = "\\n" escapeChar '\r' = "\\r" escapeChar '\t' = "\\t" - escapeChar '"' = "\"" + escapeChar '"' = "\\\"" escapeChar '\\' = "\\\\" escapeChar c | isControl c || fromEnum c >= 0x7f = uni_esc c escapeChar c = [c] |
