From b702d4ca7f3eb140a5436469e3bc05d997b1bb26 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sat, 27 Sep 2014 13:19:28 +0100 Subject: Only select the first level of h- elements --- test/microformats/parser_expectations.clj | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test') diff --git a/test/microformats/parser_expectations.clj b/test/microformats/parser_expectations.clj index 1783af5..455a26f 100644 --- a/test/microformats/parser_expectations.clj +++ b/test/microformats/parser_expectations.clj @@ -24,6 +24,27 @@ snippet :content (#'microformats.parser/node-to-text))) +(expect '({:tag :div :attrs {:class "h-card"} + :content nil}) + (select-h (snippet + "
"))) + +(expect '({:tag :div :attrs {:class "h-card"} + :content ({:tag :a :attrs {:class "h-org"} + :content nil})}) + (select-h (snippet + "
"))) + +(expect '({:tag :div :attrs {:class "h-card"} + :content ("\n" + {:tag :p :attrs nil + :content ({:tag :a :attrs {:class "h-org"} + :content nil})} + "\n")}) + (select-h (snippet "
+

+
"))) + (expect {:name '("Name")} (parse-p (snippet "

Name

"))) -- cgit 1.4.1