Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
hiccup -> clojure.xml
; problems:
; * doesn't elide empty attrs e.g. id="" class=""
; * doesn't convert e.g. {:selected true} into selected=selected
(defn- hiccup->corexml
(if (coll? x)
(let [[tag attrs content] (#'hiccup.core/normalize-element x)]
{:tag (keyword tag) :attrs attrs :content (map hiccup->corexml content)})
(str x)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.