about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-09-13 20:17:45 +0100
committerAlan Pearce2014-09-13 20:20:01 +0100
commit5814a6cadbd6f6ca36398806197d458730686e03 (patch)
tree9b512f5714c7d772cb0ed3287da9a5c45ae1eca2
parent3af8fd8a02787bed26efad80a91b8541390b8e22 (diff)
downloadmicroformats-5814a6cadbd6f6ca36398806197d458730686e03.tar.lz
microformats-5814a6cadbd6f6ca36398806197d458730686e03.tar.zst
microformats-5814a6cadbd6f6ca36398806197d458730686e03.zip
Refactor reducers for easier testing
-rw-r--r--src/microformats/parser.clj8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj
index 882759a..94f0110 100644
--- a/src/microformats/parser.clj
+++ b/src/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 @@
   "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"