about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAlan Pearce2014-09-22 21:02:04 +0100
committerAlan Pearce2014-09-22 21:02:04 +0100
commit58552fe2b3d5953b8bcc6a97fb87dc44bda4f180 (patch)
treef5003aff037ae2b923477e5ef9f22450a2d1d953 /src
parent13937a5afe64e093072b90f4fea2b99f43bf05ed (diff)
downloadmicroformats-58552fe2b3d5953b8bcc6a97fb87dc44bda4f180.tar.lz
microformats-58552fe2b3d5953b8bcc6a97fb87dc44bda4f180.tar.zst
microformats-58552fe2b3d5953b8bcc6a97fb87dc44bda4f180.zip
Test + implement multi-child property parsing
Diffstat (limited to 'src')
-rw-r--r--src/microformats/parser.clj10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj
index 8e325e3..fb0dc0d 100644
--- a/src/microformats/parser.clj
+++ b/src/microformats/parser.clj
@@ -174,13 +174,13 @@
 (defn parse-h
   "Parse h-* classes within a HTML element."
   [element]
-  (let [el (first (html/select element [(html/union [(html/attr-starts :class "p-")
-                                                     (html/attr-starts :class "u-")
-                                                     (html/attr-starts :class "dt-")
-                                                     (html/attr-starts :class "e-")])]))]
+  (let [el (html/select element [(html/union [(html/attr-starts :class "p-")
+                                              (html/attr-starts :class "u-")
+                                              (html/attr-starts :class "dt-")
+                                              (html/attr-starts :class "e-")])])]
     (hash-map :type (get-mf-names element)
               :properties (merge (parse-implied element)
-                                 (apply merge ((juxt parse-p parse-u parse-dt parse-e) el))))))
+                                 (apply merge (map #(apply merge %) (map (juxt parse-p parse-u parse-dt parse-e) el)))))))
 
 (defn select-h
   "Select h-* elements within a HTML document."