all repos — archive/microformats @ 5814a6cadbd6f6ca36398806197d458730686e03

Incomplete Clojure microformats library

Refactor reducers for easier testing

Alan Pearce
commit

5814a6cadbd6f6ca36398806197d458730686e03

parent

3af8fd8a02787bed26efad80a91b8541390b8e22

1 file changed, 4 insertions(+), 4 deletions(-)

jump to
M src/microformats/parser.cljsrc/microformats/parser.clj
@@ -6,12 +6,12 @@
(defn mf-names-from-class "Get microformat classnames from a class attribute" [prefix] - (r/filter #(.startsWith % prefix))) + #(.startsWith % prefix)) (defn remove-mf-prefix "Remove microformats prefixes from a class attribute" [prefix] - (r/map #(apply str (drop (count prefix) %)))) + #(apply str (drop (count prefix) %))) (defn- split-classes "Split a whitespace-separated string."
@@ -22,8 +22,8 @@ (defn classes-to-props
"Convert class list to list of microformat property keywords" [prefix] (comp (r/map keyword) - (remove-mf-prefix prefix) - (mf-names-from-class prefix))) + (r/map (remove-mf-prefix prefix)) + (r/filter (mf-names-from-class prefix)))) (defn element-to-classes "Get list of classes from an element"