From b14be70cb06dc34dfc1823c5cf5151a798ac7379 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 24 Sep 2014 19:07:20 +0100 Subject: Ignore
and
, even if they have mf classes This isn't actually in the spec, but microformats-tests expects it. --- src/microformats/parser.clj | 8 ++++---- test/microformats/parser_expectations.clj | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj index 4706992..0454d21 100644 --- a/src/microformats/parser.clj +++ b/src/microformats/parser.clj @@ -223,16 +223,16 @@ :photo (list (parse-implied-photo element))}))) (defn- select-p - [element] (html/select element [(html/attr-contains :class "p-")])) + [element] (html/select element [[(html/but-node #{:br :hr}) (html/attr-contains :class "p-")]])) (defn- select-u - [element] (html/select element [(html/attr-contains :class "u-")])) + [element] (html/select element [[(html/but-node #{:br :hr}) (html/attr-contains :class "u-")]])) (defn- select-dt - [element] (html/select element [(html/attr-contains :class "dt-")])) + [element] (html/select element [[(html/but-node #{:br :hr}) (html/attr-contains :class "dt-")]])) (defn- select-e - [element] (html/select element [(html/attr-contains :class "e-")])) + [element] (html/select element [[(html/but-node #{:br :hr}) (html/attr-contains :class "e-")]])) (defn get-mf-properties "Parse children of a microformat, returning a map of properties" diff --git a/test/microformats/parser_expectations.clj b/test/microformats/parser_expectations.clj index e89833b..7a94929 100644 --- a/test/microformats/parser_expectations.clj +++ b/test/microformats/parser_expectations.clj @@ -186,6 +186,16 @@ My Blog ")) +(expect {:items [{:type ["h-card"] + :properties {:name '("Example") + :tel '("01234567890")}}] + :rels {}} + (parse "
+

Example

+

01234567890

+
+
")) + (expect {:items [{:type ["h-adr"], :properties {:street-address '("665 3rd St."), -- cgit 1.4.1