diff options
author | Alan Pearce | 2014-10-10 19:57:56 +0100 |
---|---|---|
committer | Alan Pearce | 2014-10-10 19:57:56 +0100 |
commit | 4debb2f471188fdd17a03f7250050b8e83ae9b32 (patch) | |
tree | 19d8a2adcf4b3030ea7e97720073aede5f93bc72 /src | |
parent | 3213c0c46a152e709772f0818a9281f5ce0e1988 (diff) | |
download | microformats-4debb2f471188fdd17a03f7250050b8e83ae9b32.tar.lz microformats-4debb2f471188fdd17a03f7250050b8e83ae9b32.tar.zst microformats-4debb2f471188fdd17a03f7250050b8e83ae9b32.zip |
Parse values from value-title class elements
Diffstat (limited to 'src')
-rw-r--r-- | src/microformats/parser.clj | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj index 0b26372..4f63d55 100644 --- a/src/microformats/parser.clj +++ b/src/microformats/parser.clj @@ -92,6 +92,13 @@ [root url] (url/resolve (get-base-url root) url)) +(defn get-value-title-class + "Get the value-title class of elements" + [elements] + (str/join " " (into [] ((comp (r/map :title) + (r/map :attrs)) + elements)))) + (defn get-value-class "Get the value class of elements" [elements] @@ -103,8 +110,11 @@ (defn find-value-class "Find and get the value class of elements" [el] - (when-let [values (seq (html/select el [html/root :> :.value]))] - (get-value-class values))) + (anacond + (not-empty (html/select el [html/root :> :.value-title])) + (get-value-title-class %) + (not-empty (html/select el [html/root :> :.value ])) + (get-value-class %))) (declare parse-h) |