-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
category: ergonomicsQuality of Life improvementsQuality of Life improvementsgood first issuePeople will gladly help if you make it easyPeople will gladly help if you make it easytype: feature requestFeature requestsFeature requests
Description
Hi!
This seems like a fairly reasonable utility feature that I've needed in more than one place now.
(def ^:private whitespace?
"Is this a string, and does it consist of only whitespace?"
(every-pred string? (partial re-matches #"\s*")))
(defn ^:private remove-whitespace
"Walk a given Hiccup form and remove all pure whitespace."
[row]
(walk/prewalk
(fn [form]
(if (vector? form)
(into [] (remove whitespace? form))
form))
row))
(walk
is [clojure.walk :as walk]
.)
If you'd like it in Hiccup, I'm more than happy to add it (with unit tests, of course.)
marksto
Metadata
Metadata
Assignees
Labels
category: ergonomicsQuality of Life improvementsQuality of Life improvementsgood first issuePeople will gladly help if you make it easyPeople will gladly help if you make it easytype: feature requestFeature requestsFeature requests