Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jsony.nimble
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.0.1"
version = "1.0.2"
author = "Andre von Houck"
description = "A loose direct to object json parser with hooks."
license = "MIT"
Expand Down
2 changes: 2 additions & 0 deletions src/jsony.nim
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ proc dumpHook*(s: var string, v: string) =
of '\n': s.add r"\n"
of '\r': s.add r"\r"
of '\t': s.add r"\t"
of '"': s.add r"\"""
else:
s.add c
s.add '"'
Expand Down Expand Up @@ -567,6 +568,7 @@ proc dumpHook*(s: var string, v: string) =
of '\n': ss.add '\\', 'n'
of '\r': ss.add '\\', 'r'
of '\t': ss.add '\\', 't'
of '"': ss.add '\\', '"'
else:
ss.add c
ss.add '"'
Expand Down
1 change: 1 addition & 0 deletions tests/test_tojson.nim
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ doAssert 'a'.toJson == "\"a\""
match "hi there"
match "hi\nthere\b\f\n\r\t"
match "как дела"
match """ "quote\"inside" """

block:
type
Expand Down