Open aravindbaskaran opened 7 years ago
This worked with {{&}} and {{{}}}
(clostache.parser/render "{{&Currency}} {{Price}}" {:Currency "$" :Price 230})
Sorry, suffered a brain freeze, had some extra code that was making it work
(->
(clostache.parser/render "{{Currency}} {{Price}}" {:Currency "USD$" :Price 230})
(clojure.string/replace #"\\" ""))
That's the around. Thankfully no other "\" characters are there in my template. Reopening
Another, better workaround
(clostache.parser/render "{{#CurrencyFn}}{{/CurrencyFn}} {{Price}}" {:Currency "USD$" :Price 230 :CurrencyFn #(str "$"%)})
Eg 1:
(clostache.parser/render "{{Currency}} {{Price}}" {:Currency "$" :Price 230})
Output:
"\\$ 230"
Expected:
"$ 230"
Eg 2:
(clostache.parser/render "{{Currency}} {{Price}}" {:Currency "USD$" :Price 230})
Output:
"USD\\$ 230"
Expected:
"USD$ 230"