all repos — archive/microformats @ e81f922f1522030ac801c9f27b8732f0e81d2e08

Incomplete Clojure microformats library

Fix whitespace collapsing with multiple elements

Alan Pearce
commit

e81f922f1522030ac801c9f27b8732f0e81d2e08

parent

4debb2f471188fdd17a03f7250050b8e83ae9b32

2 files changed, 4 insertions(+), 1 deletion(-)

jump to
M src/microformats/parser.cljsrc/microformats/parser.clj
@@ -73,8 +73,8 @@ "Turn a node into a text string"
[content] (->> content html/texts - (map #(str/replace % #"\s+" " ")) (apply str) + (#(str/replace % #"\s+" " ")) str/trim)) (defn get-base-url
M test/microformats/parser_expectations.cljtest/microformats/parser_expectations.clj
@@ -188,6 +188,9 @@
(expect {:items '({:type ("h-card") :properties {:name ("Example User")}}) :rels {}} (parse "<p class=\"h-card\">Example User</p>")) +(expect {:items '({:type ("h-card") :properties {:name ("Example User")}}) :rels {}} + (parse "<p class=\"h-card\">Example<span> </span> User</p>")) + (expect {:items '({:type ("h-card") :properties {:name ("Example User") :url ("http://example.com")}}) :rels {}} (parse "<a class=\"h-card\" href=\"http://example.com\">Example User</a>"))