about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorAlan Pearce2014-09-13 09:53:35 +0100
committerAlan Pearce2014-09-13 09:53:35 +0100
commit1ebede4bbab4fc1315cc0bf5fdc402a29eab34e1 (patch)
tree7690a56d5677dbf7a0677577a3810c93ec4787f0 /test
parent5955c420a37fdb57eeeeb04c0f649b9d922f7fde (diff)
downloadmicroformats-1ebede4bbab4fc1315cc0bf5fdc402a29eab34e1.tar.lz
microformats-1ebede4bbab4fc1315cc0bf5fdc402a29eab34e1.tar.zst
microformats-1ebede4bbab4fc1315cc0bf5fdc402a29eab34e1.zip
Fallback to text content if attributes are not found
Diffstat (limited to 'test')
-rw-r--r--test/microformats/parser_test.clj16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/microformats/parser_test.clj b/test/microformats/parser_test.clj
index 57bb9d2..0f712de 100644
--- a/test/microformats/parser_test.clj
+++ b/test/microformats/parser_test.clj
@@ -26,8 +26,14 @@
          {:name "Example User"}
          "<abbr class=\"p-name\" title=\"Example User\">@example</abbr>"
 
+         {:name "@example"}
+         "<abbr class=\"p-name\">@example</abbr>"
+
+         {:name "Example User"}
+         "<data class=\"p-name\" value=\"Example User\"></data>"
+
          {:name "Example User"}
-         "<data class=\"p-name\" value=\"Example User\"></data>")))
+         "<data class=\"p-name\">Example User</data>")))
 
 (deftest parse-p-empty-br-hr
   (testing "br and hr tags should return empty strings"
@@ -57,4 +63,10 @@
          "<abbr class=\"u-photo\" title=\"http://example.com/someimage.png\"></abbr>"
 
          {:photo "http://example.com/someimage.png"}
-         "<data class=\"u-photo\" value=\"http://example.com/someimage.png\"></data>")))
+         "<abbr class=\"u-photo\">http://example.com/someimage.png</abbr>"
+
+         {:photo "http://example.com/someimage.png"}
+         "<data class=\"u-photo\" value=\"http://example.com/someimage.png\"></data>"
+
+         {:photo "http://example.com/someimage.png"}
+         "<data class=\"u-photo\">http://example.com/someimage.png</data>")))