borkdude / rewrite-edn

Utility lib on top of rewrite-clj with common operations to update EDN while preserving whitespace and comments.
Eclipse Public License 1.0
85 stars 14 forks source link

Escaped chars in string produces illegal result #35

Closed andelf closed 1 year ago

andelf commented 1 year ago
(print (str (borkdude.rewrite-edn/assoc (borkdude.rewrite-edn/parse-string "{}") :a "C+\\")))
;; produces
{:a "C+\"}
;; which is invalid value

See-also: https://github.com/logseq/logseq/issues/10218

borkdude commented 1 year ago

I think this is due to a rewrite-clj issue:

user=> (println (str (rewrite-clj.node/coerce "C+\\")))
"C+\"
borkdude commented 1 year ago

Bumping rewrite-clj to 1.1.47 seems to fix it.

borkdude commented 1 year ago

How are you using rewrite-edn in logseq, in a JVM, CLJS or (n)bb?

andelf commented 1 year ago

It's used as CLJS.

borkdude commented 1 year ago

Alright, bumping rewrite-clj in your project should fix this then.

andelf commented 1 year ago

Many thanks.

borkdude commented 1 year ago

Released as 0.4.7