Skip to content

Instantly share code, notes, and snippets.

@Jared314
Last active December 23, 2015 10:08
Show Gist options
  • Save Jared314/6618903 to your computer and use it in GitHub Desktop.
Save Jared314/6618903 to your computer and use it in GitHub Desktop.
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