You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
What do you mean? I meant to suggest it for inclusion in Hickory; when using Hickory I often end up with Hiccup-format data structures that have a bunch of boring whitespace in them.
Ah, your message made me think you were trying to get this into Hiccup. I suppose if this is useful it could fit in convert.cljx. Should also have some tests to go with it.
Hi!
This seems like a fairly reasonable utility feature that I've needed in more than one place now.
(
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.)
The text was updated successfully, but these errors were encountered: