all repos — archive/microformats @ 94aa44b7d5a33ca2a0efe0a72a582d24d65c0657

Incomplete Clojure microformats library

Expand selectors to match classes with prefixes

Alan Pearce
commit

94aa44b7d5a33ca2a0efe0a72a582d24d65c0657

parent

cba956458645f10a83d9f44f40b30e422de8ec63

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

jump to
M src/microformats/parser.cljsrc/microformats/parser.clj
@@ -6,12 +6,12 @@
(defn parse-p "Parse p-* classes within HTML element." [element] - (hash-map :properties (hash-map :name (first (:content (first (html/select element [:.p-name]))))))) + (hash-map :properties (hash-map :name (first (:content (first (html/select element [(html/attr-starts :class "p-")]))))))) (defn parse-h "Parse h-* classes within a HTML document." [html] - (mapv parse-p (html/select html [:.h-card]))) + (mapv parse-p (html/select html [(html/attr-starts :class "h-")]))) (defn parse "Parse a HTML string with microformats"