0

I have such code:

(defn my-journey-page [locale]
  (render-string
    (read-template "myJourney") {:api      (:api props)
                                 :feedback (:feedback props)}))
...
(def props (get-props))
...
(def default-props {:api      "https://dev"
                    :feedback (json/write-str {:feedback  {:en "en" :fi "fi" :sv "sv"}
                                               :survey {:en "en" :fi "fi" :sv "sv"}})})

And I need to help with putting a valid JSON object to feedback key. I use clostache as a template. In current case it returns:

var obj = { 
  feedback: '{"feedback":{"en":"en","fi":"fi","sv":"sv"},"survey":{"en":"en","fi":"fi","sv":"sv"}}'
}

How can I get it correctly?

Hleb
  • 7,037
  • 12
  • 58
  • 117

1 Answers1

1

For any mustache-based template system, the following should apply:

You didn't show what your template looks like, but you should be able to get the value of your feedback variable without HTML-escaping by writing {{{feedback}}} (triple braces) instead of {{feedback}} in the template.

Rörd
  • 6,556
  • 21
  • 27