Closed pesterhazy closed 7 years ago
(render "{{{data}}}" {:data "\\"})
yields "\", not "\" as expected. Seems to be the same root cause. Tested with Clojure 1.7.0.
+1, I encountered the same error with rendering dollar signs.
user=> (println (mustache/render "{{money}}" {:money "$400.00"}))
\$400.00
nil
user=> (println (mustache/render "{{{money}}}" {:money "$400.00"}))
\$400.00
nil
This is with clojure-1.7.0 and clostache-1.4.0
With Clojure 1.8 and Clostache 1.4 I currently get:
(render "{{data}}" {:data "\\"})
=> "\\\\"
(render "{{data}}" {:data "$"})
=> "\\$"
I would expect \
and $
I am having the same issue.
I've resolved this issue in my fork of clostache: https://github.com/fotoetienne/cljstache
Sorry, forgot about this... But better late than never. There was apparently indeed some change in Clojure 1.5 that broke this. I've made a quick fix inspired by @fotoetienne's changes for now, but I'm still curious why this broke, couldn't find anything obvious.
The unit test fail with current Clojure 1.6. It looks like a change between 1.4 and 1.5 broke the escaping of backslashes in the code. Maybe something related to the handling of regular expressions?