Skip to content

Instantly share code, notes, and snippets.

Last active Dec 23, 2015
What would you like to do?
Remove nodes
(require '[net.cgrand.enlive-html :as e])
(defn gen-transform [target]
(string? target) e/text-node
(map? target) (:tag target)
:else e/any-node)]
#(when (not= target %) %)])
(defn remove-node [coll & nodes]
(e/at* coll (map gen-transform nodes)))
(remove-node enlive-node
{:tag :title, :attrs nil, :content ["Stack Overflow"]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment