Skip to content

Commit 4d06d81

Browse files
committed
Fix ~ symbol
1 parent 5cf3982 commit 4d06d81

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/nextjournal/clerk/viewer.cljc

+3-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,9 @@
332332
;; https://clojurians.slack.com/archives/C03S1KBA2/p1667334982789659
333333

334334
#?(:clj (defn roundtrippable? [x]
335-
(= x (-> x str read-string))))
335+
(try
336+
(= x (-> x str read-string))
337+
(catch Exception _e false))))
336338

337339
#?(:clj
338340
(defmethod print-method clojure.lang.Keyword [o w]

test/nextjournal/clerk/viewer_test.clj

+3-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,9 @@
218218
(is (= "#viewer-eval (symbol \"with spaces\")"
219219
(pr-str (symbol "with spaces"))))
220220
(is (= "#viewer-eval (symbol \"with ns\" \"and spaces\")"
221-
(pr-str (symbol "with ns" "and spaces")))))
221+
(pr-str (symbol "with ns" "and spaces"))))
222+
(is (= "#viewer-eval (symbol \"~\")"
223+
(pr-str (symbol "~")))))
222224

223225
(testing "splicing reader conditional prints normally (issue #338)"
224226
(is (= "?@" (pr-str (symbol "?@"))))))

0 commit comments

Comments
 (0)