about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/microformats/parser.clj2
-rw-r--r--test/microformats/parser_expectations.clj3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj
index 4f63d55..8ae5665 100644
--- a/src/microformats/parser.clj
+++ b/src/microformats/parser.clj
@@ -73,8 +73,8 @@
   [content]
   (->> content
        html/texts
-       (map #(str/replace % #"\s+" " "))
        (apply str)
+       (#(str/replace % #"\s+" " "))
        str/trim))
 
 (defn get-base-url
diff --git a/test/microformats/parser_expectations.clj b/test/microformats/parser_expectations.clj
index 5486898..9c9da10 100644
--- a/test/microformats/parser_expectations.clj
+++ b/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>"))