We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi!
Using pr-str, you can print arbitrary edn data, and read it on the client side using read-string, i.e.
pr-str
read-string
user> (read-string (pr-str {:a "a"})) {:a "a"}
Passing something like this to hiccup.core/html gives the following:
hiccup.core/html
user> (println (hiccup.core/html [:div {:data-example (pr-str {:a "a"})}])) <div data-example="{:a "a"}"></div>
When getting the data-example field from ClojureScript, I can read-string the resulting string and get the data structure back.
data-example
Passing the same to dumdom.string/render gives this:
dumdom.string/render
user> (println (dumdom.string/render [:div {:data-example (pr-str {:a "a"})}])) <div data-example="{:a "a"}"></div>
Here, the data-example does not contain the expected string.
Note this is not a big issue, as something like:
user> (println (dumdom.string/render [:div {:data-example (clojure.string/escape (pr-str {:a "a"}) {\" """})}])) <div data-example="{:a "a"}"></div>
gives the expected result.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi!
Using
pr-str
, you can print arbitrary edn data, and read it on the client side usingread-string
, i.e.Passing something like this to
hiccup.core/html
gives the following:When getting the
data-example
field from ClojureScript, I canread-string
the resulting string and get the data structure back.Passing the same to
dumdom.string/render
gives this:Here, the
data-example
does not contain the expected string.Note this is not a big issue, as something like:
gives the expected result.
The text was updated successfully, but these errors were encountered: