Fix whitespace collapsing with multiple elements
2 files changed, 4 insertions(+), 1 deletion(-)
M src/microformats/parser.clj → src/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.clj → test/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>"))