add / to excluded characters in attribute names to correctly parse <br/> etc.
[catagits/HTML-Zoom.git] / t / parser_weirdness.t
diff --git a/t/parser_weirdness.t b/t/parser_weirdness.t
new file mode 100644 (file)
index 0000000..2abab01
--- /dev/null
@@ -0,0 +1,26 @@
+use strictures 1;
+use HTML::Zoom;
+use Test::More;
+
+my $html = <<EOHTML;
+<body>
+  <p><br/></p>
+  <p><br /></p>
+</body>
+EOHTML
+
+HTML::Zoom->from_html($html)
+          ->select('body')
+          ->collect_content({
+              into => \my @body
+            })
+          ->run;
+
+is(HTML::Zoom->from_events(\@body)->to_html, <<EOHTML,
+
+  <p><br/></p>
+  <p><br /></p>
+EOHTML
+  'Parses cuddled in place close ok');
+
+done_testing;