Rewrite-clj v1 is coercing strings differently than v0
lread opened this issue · 1 comments
lread commented
Version
1.0.767-alpha
Symptom
A support request form @ivarref on Slack boiled down to this observation:
v1: hey " man
❯ clj -Sdeps '{:deps {rewrite-clj/rewrite-clj {:mvn/version "1.0.767-alpha"}}}'
Clojure 1.11.1
user=> (require '[rewrite-clj.node :as n])
nil
user=> (-> "hey \" man" n/coerce n/string pr-str println)
"\"hey \" man\""
v0: hey \" man
❯ clj -Sdeps '{:deps {rewrite-clj/rewrite-clj {:mvn/version "0.6.1"}}}'
Clojure 1.11.1
user=> (require '[rewrite-clj.node :as n])
nil
user=> (-> "hey \" man" n/coerce n/string pr-str println)
"\"hey \\\" man\""
Expected behavior
We are wrapping a coerced string in "
so we need to escape any inner "
.
(v0 behavior is correct)
Action
I'll follow up with a fix.