diff options
-rw-r--r-- | src/microformats/parser.clj | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj index 8bc7c3c..e3de0a1 100644 --- a/src/microformats/parser.clj +++ b/src/microformats/parser.clj @@ -4,18 +4,17 @@ [clojure.core.reducers :as r] [clojure.string :as str])) -(defmacro cond-let +(defmacro anacond [& clauses] (when clauses (list 'if-let ['% (first clauses)] (if (next clauses) (second clauses) (throw (IllegalArgumentException. - "cond-let requires an even number of forms"))) - (cons 'cond-let (next (next clauses)))))) + "anacond requires an even number of forms"))) + (cons 'anacond (next (next clauses)))))) -(defn mf-names-from-class - "Get microformat classnames from a class attribute" +(defn prefixed-by? [prefix] #(.startsWith % prefix)) @@ -34,7 +33,7 @@ [prefix] (comp (r/map keyword) (r/map (remove-mf-prefix prefix)) - (r/filter (mf-names-from-class prefix)))) + (r/filter (prefixed-by? prefix)))) (defn element-to-classes "Get list of classes from an element" @@ -169,7 +168,7 @@ [element] (->> element element-to-classes - (r/filter (mf-names-from-class "h-")) + (r/filter (prefixed-by? "h-")) (into []))) (defn- parse-implied-name |