Fork me on GitHub

Howdy! ClojureScript's pprint seems to be appending whitespace to linebreaks.


Here's an example:

(with-out-str (pprint ['yay
        {:lirum :larum}
        {:foo {:bum/bar
          [{:ding/baz {:buz 42}}
           {:ding 'dong}]}}]))
This will insert a line break after yay and :larum}, but also a space before the line break, so [yay \n {:lirum :larum} \n ... This behaviour is different than that of Clojure's pprint, and eg generating edn with clojurescript might make a linter angry.


I created a test-case that fails for cljs.pprint/pprint, but passes for jvm-clojure's pprint. I wanted to see if I could fix it, by creating a new ns, cljs.pprint2, and pasting in the content of However, using cljs.pprint2/pprint, the test now passes. The mysterious thing is that cljs.pprint.cljs hasn't changed in two years, according to the repo, and I'm using latest 1.10.891.


Yes, it is possible to use MUI’s selects in your clojurescript code.

🙌 1