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?

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Actually, I use clostache. I'll update question with it
OK, my answer should work with all mustache-based template systems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.