Created
March 23, 2014 02:52
-
-
Save kurtharriger/9717936 to your computer and use it in GitHub Desktop.
Clojure script to strip classes from html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[net.cgrand.enlive-html :as html]) | |
(defn render [e] (apply str (html/emit* e))) | |
(defn strip-classes | |
"Remove class attribute from all elements" | |
[file] | |
(-> | |
(html/html-resource file) | |
(html/at [(html/attr? :class)] (html/remove-attr :class)) | |
(render))) | |
;; (spit "clean.html (strip-classes "index.html")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment