diff --git a/jsony.nimble b/jsony.nimble index af59c73..fda365c 100644 --- a/jsony.nimble +++ b/jsony.nimble @@ -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" diff --git a/src/jsony.nim b/src/jsony.nim index 4eeb3ee..533ef2e 100644 --- a/src/jsony.nim +++ b/src/jsony.nim @@ -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 '"' @@ -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 '"' diff --git a/tests/test_tojson.nim b/tests/test_tojson.nim index 1a0a99d..44764db 100644 --- a/tests/test_tojson.nim +++ b/tests/test_tojson.nim @@ -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