Skip to content

Commit e562ca4

Browse files
committed
escape error messages when turning them to JSON
1 parent 9f92ced commit e562ca4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/Reporting/Doc.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,18 +394,18 @@ toColor layer intensity color =
394394
encodeChunks :: Style -> [String] -> E.Value
395395
encodeChunks (Style bold underline color) revChunks =
396396
let
397-
str = Json.fromChars (concat (reverse revChunks))
397+
chars = concat (reverse revChunks)
398398
in
399399
case color of
400400
Nothing | not bold && not underline ->
401-
E.string str
401+
E.chars chars
402402

403403
_ ->
404404
E.object
405405
[ "bold" ==> E.bool bold
406406
, "underline" ==> E.bool underline
407407
, "color" ==> maybe E.null encodeColor color
408-
, "string" ==> E.string str
408+
, "string" ==> E.chars chars
409409
]
410410

411411

0 commit comments

Comments
 (0)