Skip to content

Instantly share code, notes, and snippets.

@Jared314
Last active Dec 23, 2015
Embed
What would you like to do?
Remove nodes
(require '[net.cgrand.enlive-html :as e])
(defn gen-transform [target]
[[(cond
(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"]}
"\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment