Append HTML with Enlive
Setting the content of nodes to either escaped text (using content), or HTML (using html-content) is pretty obvious. But here's how you can use HTML with the other Enlive transformers.
[:div] (append (html [:script "alert('Hello, World!')"]))
The html function takes a Hiccup style data structure of nodes which it will convert to an Enlive map for the HTML.
(html [:div.control-group [:label.control-label "Label:"]])
Very useful.
Written by Rhodri Pugh
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Clojure
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#